DynaPDF Manual - Page 144

Previous Page 143   Index   Next Page 145

Function Reference
Page 144 of 839
AddImage
Syntax:
LBOOL pdfAddImage(
const PPDF* IPDF,
// Instance pointer
TCompressionFilter Filter,
// See below
TImageConversionFlags Flags, // See below
struct TPDFImage* Image)
// Image structure
typedef enum
{
cfFlate
= 0,
// PDF or TIFF output
cfJPEG
= 1,
// PDF, JPEG, or TIFF output
cfCCITT3
= 2,
// PDF or TIFF output -> B&W CCITT Fax G3 compression
cfCCITT4
= 3,
// PDF or TIFF output -> B&W CCITT Fax G4 compression
cfLZW
= 4,
// TIFF or GIF output -> Much faster than flate
cfLZWBW
= 5,
// TIFF
cfFlateBW
= 6,
// TIFF, PNG, or BMP output -> Dithered black & white.
// The resulting image is compressed with Flate or left
// uncompressed if the output image format is a bitmap.
// If you want to use CCITT Fax 4 compression (TIFF
// only) then set the flag icUseCCITT4.
cfJP2K
= 7
// PDF or JPEG2000 output
cfNone
= 255, // TIFF output only
}TCompressionFilter;
typedef enum
{
icNone
= 0, // Default
icUseCCITT4 = 1
// Use CCITT Fax 4 for dithered images.
}TImageConversionFlags;
The function adds an image that was returned by the content parser to the current open image file.
The output image must be opened with CreateImage() beforehand.
If the output format is TIFF, multiple images can be added to the file while each image can be
compressed with a different compression filter. All other image formats support only one image. So,
the image must be closed with CloseImage() after the image was added to the file in this case.
Depending on the output format the compression filter cannot be freely chosen. For example, PNG
is the native image format for Flate compression. This format supports Flate compression only. If an
incompatible filter is set the function uses the default filter for the output format, e.g. Flate for PNG,
JPEG for JPG, and so on.
The compression level can be adjusted with the function SetCompressionLevel(). The JPEG quality
can be set with SetJPEGQuality().
The function is able to create up to 2 GB large TIFF files. As far as the images are compressed with
the original filters it is usually always possible to add all images of a PDF file to one TIFF file.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
 

Previous topic: Page numbering, Header / footer text, Header / footer types

Next topic: AddInkList, AddJavaScript