Click or drag to resize
Pdftools logo

ConverterConvertPage Method

Convert a single page of a PDF document to a rasterized image


Namespace: PdfTools.Pdf2Image
Assembly: PdfTools (in PdfTools.dll) Version: 1.4.0+fc8bb87ea2616e7f35d94e0588d333abae862a7a
Syntax
C#
public Document ConvertPage(
	Document inDoc,
	Stream outStream,
	Profile profile,
	int pageNumber
)

Parameters

inDoc  Document
The input PDF document
outStream  Stream
The stream to which the rasterized image is written.
profile  Profile

The profile defines how the PDF page is rendered and what type of output image is used.

For details, see Profile.

pageNumber  Int32
The PDF page number to be converted. The number must be in the range of 1 (first page) to PageCount (last page).

Return Value

Document

The image object allowing to open and read the output image and treat it as a new input for further processing.

Note that, this object must be disposed before the output stream object (method argument outStream).

Exceptions
ExceptionCondition
LicenseExceptionThe license is invalid.
ArgumentExceptionThe pageNumber is not in the allowed range.
IOExceptionWriting to the output image failed.
UnsupportedFeatureExceptionThe input PDF is a collection that has no cover pages.
UnsupportedFeatureExceptionThe input PDF contains unrendered XFA form fields. See Xfa for more information on how to detect and handle XFA documents.
GenericExceptionAn unexpected failure occurred.
ProcessingExceptionThe processing has failed.
ArgumentNullExceptionif inDoc is .
ArgumentNullExceptionif outStream is .
ArgumentNullExceptionif profile is .
See Also