Click or drag to resize
Pdftools logo

DocumentCreate Method

Create a new PDF document.

Documents with created with this method are writable and can be modified.

Namespace: PdfTools.Toolbox.Pdf
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.1.0+5820e9ca9ca173983539ffc40abc227fb62e6928
Syntax
C#
public static Document Create(
	Stream stream,
	Conformance? conformance,
	Encryption encryption
)

Parameters

stream  Stream

The stream where the PDF document is stored.

Both, read and write access is required.

conformance  NullableConformance

The required conformance level of the PDF document. Adding pages or content from incompatible documents or using incompatible features will lead to a conformance error.

When using , the conformance is determined automatically, based on the conformance of the input documents and the requirements of the used features.

Note that for PDF/A document it is highly recommended to set an output intent using OutputIntent.

encryption  Encryption
the optional encryption parameters

Return Value

Document
the newly created document instance
Exceptions
ExceptionCondition
IOExceptionError writing to the stream.
ConformanceExceptionIf the conformance level is lower than 1.7 and Unicode passwords are specified. In this context "a Unicode password" is essentially one containing characters that are not in the Windows ANSI encoding (Windows Code Page 1252).
ArgumentNullExceptionif stream is .
See Also