Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 243

Previous Page 242   Index   Next Page 244

Function Reference
Page 243 of 750
LBOOL pdfCreateImage(
const PPDF* IPDF,
// Instance pointer
const char* FileName, // Ouput file name or NULL
TImageFormat Format)
// Output image format
typedef enum
// RGB, CMYK, Gray, B&W -> CCITT 3/4, JPEG, Flate, LZW
// RGB, CMYK, Gray -> JPEG compression
// Gray, RGB, B&W
-> Flate compression
ifmReserved, // Reserved for future extensions
// Gray, RGB, B&W
-> Uncompressed
// RGB, CMYK, Gray -> JPEG2000 compression
The function creates an empty image in the specified format. This is a helper function to create image
files from the rasterizer or from raw images returned by the content parser. See ParseContent() or
RenderPage() for further information. After the image was created one or more images can be added
to it with AddImage(). Note that TIFF is the only supported multi-page format. All other formats
support exactly one image.
If the parameter FileName is set to NULL the image is created in memory. In this case the image
buffer is available after CloseImage() was called. To get the file buffer call the function
GetImageBuffer(). Note that the internal resources of memory based images must be manually freed
with FreeImageBuffer() in this case.
When the function is used to create images from the rasterizer, the supported pixel formats of the
output image format must be considered. The following table specifies which combinations are
Image Format
Supported Pixel Formats
BMP (Bitmap)
pxf1Bit, pxfGray, pxfBGR, pxfBGRA
pxfGray, pxfRGB, pxfRGBA
JPEG 2000 (JPC)
pxf1Bit, pxfGray, pxfRGB
pxf1Bit, pxfGray, pxfRGB, pxfRGBA
pxf1Bit, pxfGray, pxfRGB, pxfRGBA
CreateImage() can be used in combination with ParseContent() or RenderPage() and AddImage().
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: CreateICCBasedColorSpace

Next topic: CreateIndexedColorSpace