DynaPDF Manual - Page 294

Previous Page 293   Index   Next Page 295

Function Reference
Page 294 of 839
The difference in comparison to CreateRasterizer() is that this version creates a DIB Section in the
specified size and pixel format that is compatible to a device context. A DIB Section is required to
render into a device context with RenderPageEx(). The image buffer is released when the rasterizer
is deleted.
The function supports the pixel formats pxf1Bit, pxfGray, pxfBGR, and pxfBGRA. The pixel format
pxfBGRA should only be used when the page is rendered over an arbitrary background image. The
default pixel format on Windows is pxfBGR.
The pixel format is directly connected with the rasterizer and cannot be changed at runtime. When
the pixel format must be changed then delete the rasterizer and create a new one in that pixel
The size of the image buffer can be changed at runtime with ResizeBitmap().
At time of publication this function can be used on Windows only.
The rasterizer uses the error log of the PDF instance to output warnings and error messages but it
does never raise PDF exceptions. So, an error that occurs during rendering does not affect the PDF
file in memory.
Return values:
When the function succeeds the return value is the pointer of the rasterizer object. If the function
fails the return value is NULL.
SI32 pdfCreateRectilinearMeasure(
const PPDF* IPDF,
// Instance pointer
UI32 Viewport,
// Viewport handle (required)
double Scale,
// Scaling factor (required)
const char* UnitDescription,
// Unit description, e.g. "Inch to mm"
const char* LabelDistance,
// Label for the distance tool, e.g. "mm"
const char* LabelArea)
// Label for the area tool, e.g. "mm²"
The function creates a rectilinear measure dictionary. This kind of measure dictionary can be used to
convert PDF units to an arbitrary other unit like millimeters, meters, feets, and so on.
A measure dictionary is used by the measure tool of Adobe's Acrobat and by other PDF viewers
which contain a PDF compatible measure tool.
The parameter Viewport must be a viewport handle that was returned by CreateViewport(). Scale is
the required scaling factor to convert a PDF unit (1/72 inch) to the wished destination unit. The
parameters UnitDescription, LabelDistance, and LabelArea are all required and cannot be NULL.
UnitDescription is a description of the coordinate conversion, e.g. "Inch to mm".

Previous topic: CreateRasterizerEx (Rendering Engine)

Next topic: CreateResetAction, CreateSeparationCS