Click or drag to resize

ConvertToPdfAsync Method (PDFDoc, IFilter, String)

Converts the file or document to PDF and append to the specified PDF document.

Namespace:  pdftron.PDF
Assembly:  pdftron (in pdftron.dll) Version: 255.255.255.255
Syntax
public static IAsyncAction ToPdfAsync(
	PDFDoc doc,
	IFilter filter,
	string fileType
)

Parameters

doc
Type: pdftron.PDFPDFDoc
The PDFDoc to append the converted document to.
filter
Type: pdftron.FiltersIFilter
The IFilter object to convert
fileType
Type: SystemString
Type (name extension) of the file

Return Value

Type: IAsyncAction
An object used for managing the asynchronous operation.
Remarks

Supported formats include BMP, EMF, JPEG, PNG, TIF, XPS.

Use this method to convert a file pointed by any Windows Runtime stream handles (i.e. IInputStream, IStorageFile, etc.). Wrap the Windows Runtime stream with PDFNet's filter classes, then pass it to this method.

Examples
StorageFile img = await storageFolder.GetFileAsync("myImage.jpg");
IRandomAccessStream randomStream = await img.OpenReadAsync();
RandomAccessStreamFilter filter = new RandomAccessStreamFilter(randomStream)

await pdftron.PDF.Convert.ToPdfAsync(doc, filter, "jpg");

See Also