Click or drag to resize

PdfDocumentLoad Method (Byte, PdfForms, String)

Open and load a PDF document from a memory.

Namespace:  Patagames.Pdf.Net
Assemblies:   Patagames.Pdf.Xamarin.iOS (in Patagames.Pdf.Xamarin.iOS.dll) Version: 4.81.2704
  Patagames.Pdf (in Patagames.Pdf.dll) Version: 4.81.2704
public static PdfDocument Load(
	byte[] content,
	PdfForms forms = null,
	string password = null


Type: SystemByte
Pointer to a buffer containing the PDF document
forms (Optional)
Type: Patagames.Pdf.NetPdfForms
Instance of PdfForms class that will be associated with loaded document
password (Optional)
Type: SystemString
A string used as the password for PDF file. If no password needed, empty or NULL can be used.

Return Value

Type: PdfDocument
Instance of PDFDocument class
UnknownErrorExceptionUnknown error
PdfFileNotFoundExceptionFile not found or could not be opened
BadFormatExceptionFile not in PDF format or corrupted
InvalidPasswordExceptionPassword required or incorrect password
UnsupportedSecuritySchemeExceptionunsupported security scheme
PdfiumExceptionError occured in Pdfium. See ErrorCode for detail
NoLicenseExceptionThis exception thrown only in trial mode if document cannot be opened due to a license restrictions"
Note Note

The application should maintain the byte array being valid until the PDF document close.

With the trial version the documents which size is smaller than 1024 Kb, or greater than 10 Mb can be loaded without any restrictions. For other documents the allowed ranges is 1.5 - 2 Mb; 2.5 - 3 Mb; 3.5 - 4 Mb; 4.5 - 5 Mb and so on.

See Also