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.Pdf
Assembly: PdfTools (in PdfTools.dll) Version: 1.6.0+e1db8f4bf6125495a2d29513486ea3e61205c81b
Syntax
C#
public static Document Open(
	Stream stream,
	string password = null
)

Parameters

stream  Stream
The stream from which the PDF is read.
password  String  (Optional)
The password to open the PDF document. If or empty, no password is used.

Return Value

Document
The newly created document instance
Exceptions
ExceptionCondition
LicenseExceptionThe license check has failed.
PasswordExceptionThe document is encrypted and the password is invalid.
CorruptExceptionThe document is corrupt or not a PDF.
UnsupportedFeatureExceptionThe document is an unencrypted wrapper document.
GenericExceptionA generic error occurred.
ArgumentNullExceptionif stream is .
See Also