DynaPDF Manual - Page 603

Previous Page 602   Index   Next Page 604

Function Reference
Page 603 of 818
in which the image shall be painted. Typically, this is done within a pair of save/restore graphics
state operators to isolate the effect of the transformation, which can include translation, rotation,
reflection, and skew.
Please note that the content parser returns images as is. It is maybe required to mirror an image on
the x- or y-axis or to rotate it according to the current transformation matrix. DynaPDF does not
provide functions to manipulate images.
Helper functions
When extracting images it is usually required to create some kind of image file from the raw image
data that is returned by the content parser. The following helper functions can be used to create
image files:
CreateImage()
AddImage()
CloseImage()
CreateImage() supports the creation of single and multi-page images (TIFF only). To create a multi-
page image the function must be called before ParseContent() or before parsing the first page. If all
images should be stored in the image file the flag pfDecomprAllImages must be set.
The function converts images that use a complex color space to the nearest device color space by
default. It is also possible to convert images to a specific device color space by setting one of the
flags pfConvImagesToGray, pfConvImagesToRGB, or pfConvImagesToCMYK.
Also if a color conversion flag is set, 1 bit images and gray images are never converted into a higher
color space.
JPEG and JPEG 2000 images are already stored in valid file formats in PDF. If the creation of a multi-
page TIFF image is not required then it is usually best to extract these image formats as is. In this
case the flag pfDecomprAllImages must be absent.
16 bit images
Images which use 16 bits per component are supported by these encoders:
JPEG 2000
PNG
TIFF
All other encoders do not yet support 16 bit images. Note also that 16 bit CMYK images are not
supported by most image viewers.
DynaPDF is delivered with the demo project image_extraction that demonstrates how images can be
extracted.
 

Previous topic: Physical organization of images, Image coordinate space

Next topic: Vector Graphics


Start Chat