DynaPDF Manual - Page 656

Previous Page 655   Index   Next Page 657

Function Reference
Page 656 of 839
typedef enum
{
cfFlate
= 0,
// TIFF output
cfJPEG
= 1,
// TIFF or JPEG output
cfCCITT3
= 2,
// TIFF output, see 1 Bit Rendering
cfCCITT4
= 3,
// TIFF output, see 1 Bit Rendering
cfLZW
= 4,
// TIFF output
cfLZWBW
= 5,
// TIFF, see 1 Bit Rendering
cfFlateBW
= 6,
// BMP, PNG, TIFF, see 1 Bit Rendering
cfJP2K
= 7
// JPEG 2000 output
cfNone
= 255, // TIFF output only
// These flags can be combined with cfCCITT3/4, cfFlate, and cfLZW.
cfDitherFloydSteinberg = 0x00001000, // Floyd Steinberg dithering.
cfConvGrayToOtsu
= 0x00002000, // The Otsu filter is a special filter to produce black &
// white images. It is very useful if an OCR scan should be
// applied on the resulting 1 bit image. The flag will be
// considered if the pixel format was set to pxfGray.
cfOrderedDithering
= 0x00004000
// Ordered dithering. The difference in comparison to the
// pixel format pxf1Bit is that we render into a GrayA
// buffer instead of a native 1 bit buffer since this one
// produces incorrect results in certain transparency
// calculations.
}TCompressionFilter;
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:
 

Previous topic: RenderPageToImage (Rendering Engine)

Next topic: 1 Bit Rendering, Dithering