PdfDocument.Open(String, OpenOptions, CancellationToken) Method

Loads a PDF file from a file path.

public static PdfDocument Open(
	string path,
	OpenOptions? options = null,
	CancellationToken cancellationToken = default
)
Namespace
PdfToSvg
Package
PdfToSvg.NET (since v0.7.0)

Parameters

path  String
Path to PDF file to open.
options  OpenOptions  (Optional)
Additional options for loading the PDF.
cancellationToken  CancellationToken  (Optional)
Token for monitoring cancellation requests.

Return Value

PdfDocument
PdfDocument for the specified file.

Exceptions

ExceptionCondition
ArgumentNullExceptionpath is null.
ArgumentExceptionpath is empty.
IOExceptionAn IO error occured while reading the file.
FileNotFoundExceptionNo file was found at path.
InvalidCredentialExceptionThe input PDF is encrypted, but an incorrect password was specified, or not specified at all.
PdfExceptionThe input PDF could not be parsed.

See Also

PdfDocument Class
Open Overload
PdfToSvg Namespace