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.0.0+fdabb036503e9f99735634a6d4f5be875399e9f5
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