DynaPDF Manual - Page 640

Previous Page 639   Index   Next Page 641

Function Reference
Page 640 of 818
typedef enum
{
pxf1Bit,
// BMP, PNG, or TIFF output
pxfGray,
// BMP, PNG, JPEG, JPEG 2000, or TIFF output
pxfGrayA, // PNG or TIFF output
pxfRGB,
// PNG, JPEG, JPEG 2000, or TIFF output
pxfBGR,
// BMP
pxfRGBA,
// BMP, PNG, TIFF
pxfBGRA,
// BMP
pxfARGB,
// Unsupported
pxfABGR,
// Unsupported
pxfCMYK,
// TIFF, JPEG
pxfCMYKA
// TIFF, JPEG
}TPDFPixFormat;
typedef enum
{
ifmTIFF,
// 1 bit, gray, RGB, CMYK, CMYKA, CCITT 3/4, JPEG, Flate, LZW
ifmJPEG,
// Gray, RGB, CMYK, CMYKA, JPEG compression
ifmPNG,
// 1 bit, gray, RGB, Flate compression
ifmReserved, // Reserved for future extensions
ifmBMP,
// 1 bit, gray, RGB, uncompressed
ifmJPC
// 1 bit, gray, RGB, JPEG 2000 compression
}TImageFormat;
The function renders a PDF page to an image. The page that should be rendered must be closed
(Append() or EditPage() open a page and EndPage() closes a page).
If the parameter OutFile is set to NULL the image is created in memory. In this case call
GetImageBuffer() to get the image buffer and call finally FreeImageBuffer() to release it.
It is also possible to create the output image beforehand with CreateImage(). In this case the image
will be added to this image encoder and the parameter OutFile will be ignored. This can be useful
when creating multi-page TIFF images because the compression filter can be changed on every page
if necessary.
The output image size can be calculated in different ways:
Resolution > 0 and Width == 0 and Height == 0
Pages are rendered according to the given resolution. Note that PDF pages can be very large.
Therefore, it is maybe not possible to render the page in the wished resolution.
Resolution > 0 and Width < 0 and or Height < 0
Pages are rendered according to the given resolution. Negative values of Width and Height
are interpreted as maximum width or height if Resolution is greater zero. Since PDF pages
can be very large, it is recommended to set the maximum width and height to a value that is
low enough so that no out of memory exception occurs, e.g. 5000 x 5000 pixels.
Resolution == 0 and Width > 0 or Height > 0
Pages are scaled to the given Width or Height. If Width and Height are greater zero then pages
are scaled to that size independent of the original page format (not recommended). It is
usually best to set the width or height to zero so that the function can calculate the missing
value to preserve the aspect ratio.
The pixel format and the output image format must be compatible. Because TIFF is the only image
format that supports different compression filters, the parameter Filter will be ignored for all other
 

Previous topic: RenderPageToImage (Rendering Engine)

Next topic: 1 Bit Rendering, Dithering


Start Chat