Click or drag to resize

PdfDocumentLoad(Stream, PdfForms, String, Boolean) Method

Loads the PDF document from the specified stream.

Namespace: Patagames.Pdf.Net
Assembly: Patagames.Pdf (in Patagames.Pdf.dll) Version: 4.89.2704
Syntax
public static PdfDocument Load(
	Stream stream,
	PdfForms forms = null,
	string password = null,
	bool leaveOpen = true
)

Parameters

stream  Stream
The stream containing the PDF document to load. The stream must support seeking.
forms  PdfForms  (Optional)
Instance of PdfForms class that will be associated with loaded document
password  String  (Optional)
A string used as the password for PDF file. If no password needed, empty or NULL can be used.
leaveOpen  Boolean  (Optional)
true if the application would like the stream to remain open after closing document.

Return Value

PdfDocument
Instance of PDFDocument class
Exceptions
ExceptionCondition
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"
Remarks
Note  Note

The application should maintain the stream resources 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