DynaPDF Manual - Page 578

Previous Page 577   Index   Next Page 579

Function Reference
Page 578 of 787
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.
JPEG and JPEG 2000 images are already stored in valid formats in PDF. If the creation of one multi-
page TIFF image per PDF file is not required then it is usually best to extract these image formats as
is. In this case the flag pfDecomprAllImages must be absent.
DynaPDF is delivered with the demo project image_extraction which demonstrates how images can
be extracted.
Vector Graphics
To extract vector graphics the following callback functions should be set:
TBeginPattern
TEndPattern
// Optional
TBeginTemplate
TBezierTo1
TBezierTo2
TBezierTo3
TClipPath
TClosePath
TEndTemplate
// Optional
TLineTo
TMoveTo
TMulMatrix
TRectangle
TRestoreGraphicState
TSaveGraphicState
TSetExtGState
// Optional
TSetFillColor
TSetLineCapStyle
TSetLineDashPattern
TSetLineJoinStyle
TSetLineWidth
TSetMiterLimit
TSetStrokeColor
The graphics state should contain these variables:
 

Previous topic: Physical organization of images, Image coordinate space

Next topic: PlaceImage

Start Chat