Click or drag to resize
Pdftools logo

ConverterConvert Method

Convert an image to a PDF document


Namespace: PdfTools.Image2Pdf
Assembly: PdfTools (in PdfTools.dll) Version: 1.6.0+e1db8f4bf6125495a2d29513486ea3e61205c81b
Syntax
C#
public Document Convert(
	Document image,
	Stream outStream,
	Profile profile,
	OutputOptions outOptions = null
)

Parameters

image  Document
The input image document containing one or more pages.
outStream  Stream
The stream to which the PDF is written.
profile  Profile

The profile defines the properties of the output document and how the images are placed onto the pages.

For details, see Profile.

outOptions  OutputOptions  (Optional)
The PDF output options, e.g. to encrypt the output document.

Return Value

Document

The resulting output PDF which can be used 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.
IOExceptionWriting to the output PDF failed.
CorruptExceptionThe input image document is corrupt and cannot be read.
GenericExceptionAn unexpected failure occurred.
ProcessingExceptionThe conversion failed.
ArgumentExceptionThe profile specifies invalid options.
ArgumentExceptionThe outOptions specifies document encryption and the profile PDF/A conformance, which is not allowed.
ArgumentNullExceptionif image is .
ArgumentNullExceptionif outStream is .
ArgumentNullExceptionif profile is .
See Also