Click or drag to resize

PDFDrawExportAsStreamAsync Method

Exports a page to an image as a stream, including header. This stream is can be used in JavaScript's URL.createObjectURL to create a source for an image. If the image is rendered as a bitmap, it can also be used in C# with BitmapImage.SetSource[Async].

Namespace:  pdftron.PDF
Assembly:  pdftron (in pdftron.dll) Version: 255.255.255.255
Syntax
public IAsyncOperation<IRandomAccessStreamWithContentType> ExportAsStreamAsync(
	Page page,
	string format
)

Parameters

page
Type: pdftron.PDFPage
The page to export.
format
Type: SystemString
The file format of the output image. Currently supported formats are:
  • "RAW" : RAW format. There are four possibilities: e_rgba - if transparent and color page; e_gray_alpha - if transparent and gray page; e_rgb - if opaque and color page; e_gray - if opaque and gray page. NOTE that if page is set to be transparent (SetPageTransparent), the output color channels are already multiplied by the alpha channel.
  • "BMP" : Bitmap image format (BMP).
  • "JPEG" : Joint Photographic Experts Group (JPEG) image format.
  • "PNG" : 24-bit W3C Portable Network Graphics (PNG) image format.
  • "PNG8" : 8-bit, palettized PNG format. The exported file size should be smaller than the one generated using "PNG", possibly at the expense of some image quality.
  • "TIFF" : Tag Image File Format (TIFF) image format.
  • "TIFF8" : Tag Image File Format (TIFF) image format (with 8-bit palette).

Return Value

Type: IAsyncOperationIRandomAccessStreamWithContentType
When this method completes, it returns the stream as IRandomAccessStreamWithContentType.
See Also