Mako Image Extract looks for images on every page of the specimen PDF (or other supported PDL) then dumps them as an image file.
Mako Image Extract v1.0.0.X
makoimageextract input.xxx [output.yyy] [parameter=setting] [parameter=setting] ...
Where:
input.xxx source file from which to extract pages, where xxx is pdf, xps, pxl (PCL/XL) or pcl (PCL5).
output.yyy file to write the output to, where yyy is png, jog or tif.
If no output file is declared, <input>.png is assumed.
parameter=setting one or more settings, described below.
Parameters:
p[assword]=<password> PDF password, if required to open the file.
f[older]=yes|no Create a folder to contain the output, named according to the output file name.</code></pre>
TEXT
Images are not a node type in Mako. Instead you will find them inside image or masked brushes, which are then used as fills, strokes, or opacity (soft) masks used in bona-fide nodes (for example, but not limited to, paths or glyphs nodes).
The way an everyday plain image will be represented is to be put inside an IDOMImageBrush
, which is then used as the fill on a rectangular path that defines the area the image occupies. To find them, Mako Image Extract begins by collecting all the nodes on the page that are paths:
CEDLVector<IDOMNodePtr> pathNodes;
page->getContent()->findChildrenOfType(eDOMPathNode, pathNodes, true);
CPP
It then examines each path node by getting its fill (with path->getFill()
). If this is successful then the type of brush is determined by casting to an IDOMImageBrush
and IDOMMaskedBrush
:
IDOMImageBrushPtr imageBrush = edlobj2IDOMImageBrush(brush);
IDOMMaskedBrushPtr maskedBrush = edlobj2IDOMMaskedBrush(brush);
CPP
The result of the cast will be non-null if the cast succeeded. From here the image is retrieved with getImageSource()
, with an additional step needed for a masked image. The image is then encoded for the requested image type and written to disk, in the case below to PNG:
IDOMPNGImage::encode(jawsMako, image, IOutputStream::createToFile(jawsMako, outputFilePath));
CPP
- Image brushes and how they are used in Mako