Click or drag to resize
Pdftools logo

DocumentOpen Method

Open a PDF document.

Documents opened with this method are read-only and cannot be modified.

Namespace: PdfTools.Toolbox.Pdf
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.3.0+2e7887cb8ae45c4d911ad975ad001ac2f1f257d8
Syntax
C#
public static Document Open(
	Stream stream,
	string password
)

Parameters

stream  Stream

The stream where the PDF document is stored.

Read access is required.

password  String
the password to open the PDF document

Return Value

Document
the newly created document instance
Exceptions
ExceptionCondition
PasswordExceptionif the file is encrypted and the password is not valid.
IOExceptionError reading from the stream.
CorruptExceptionif the file is corrupt or not a PDF.
UnsupportedFeatureExceptionif the file is a PDF collection.
UnsupportedFeatureExceptionif the PDF contains unrendered XFA fields.
ConformanceExceptionif the document's conformance level is not supported
ArgumentNullExceptionif stream is .
See Also