DynaPDF Manual - Page 677

Previous Page 676   Index   Next Page 678

Function Reference
Page 677 of 860
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.
Before rendering the first page the application should set the path from which external CMaps can
be loaded (see SetCMapDir()). Set the path with the flag lcmDelayed so that the files will only be
loaded if necessary.
Rendering speed can be improved by enabling the image cache. See EnableImageCache() for further
information.
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
 

Previous topic: RenderPageToImage (Rendering Engine)

Next topic: 1 Bit Rendering, Dithering