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
CreateImage
Syntax:
LBOOL pdfCreateImage(
const PPDF* IPDF,
// Instance pointer
const char* FileName, // Ouput file name or NULL
TImageFormat Format)
// Output image format
typedef enum
{
ifmTIFF,
// RGB, CMYK, Gray, B&W -> CCITT 3/4, JPEG, Flate, LZW
ifmJPEG,
// RGB, CMYK, Gray -> JPEG compression
ifmPNG,
// Gray, RGB, B&W
-> Flate compression
ifmReserved, // Reserved for future extensions
ifmBMP,
// Gray, RGB, B&W
-> Uncompressed
ifmJPC
// RGB, CMYK, Gray -> JPEG2000 compression
}TImageFormat;
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
valid:
Image Format
Supported Pixel Formats
BMP (Bitmap)
pxf1Bit, pxfGray, pxfBGR, pxfBGRA
JPEG
pxfGray, pxfRGB, pxfRGBA
JPEG 2000 (JPC)
pxf1Bit, pxfGray, pxfRGB
PNG
pxf1Bit, pxfGray, pxfRGB, pxfRGBA
TIFF
pxf1Bit, pxfGray, pxfRGB, pxfRGBA
Remarks:
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