Xojo Conferences
XDCMay2019MiamiUSA
MBSOct2019CologneDE

DynaPDF Manual - Page 586

Previous Page 585   Index   Next Page 587

Function Reference
Page 586 of 766
DefScale specifies how the page should be scaled into the image buffer. If the width and height of the
image buffer corresponds with the scaled width and height of the page, psFitWidth, psFitHeight,
and psFitBest produce all the same result (see enum TPDFPageScale). If the width or height are
different, the page is scaled into the image according to DefScale.
The mode psFitZoom should be used when zooming into a page since it avoids adjustments on the
transformation matrix.
When a page is scaled into the destination image it is usually best to draw the page into a frame
rectangle. The frame rectangle represents the area outside the page's bounding box but inside the
optional clipping rectangle.
Example:
Frame rectangle filled with an
Without the frame rectangle there
arbitrary color.
is no way to determine where the
page contents starts or ends.
Page area
Page area
Whether a frame rectangle should be drawn or not depends on the way how a page is rendered into
the destination window. If the viewer processes mainly simple PDF files then it is possible to render
pages simply on demand. The page can then directly be scaled into the destination image and in this
case it is usually best to draw the page into a frame rectangle.
However, scrolling and zooming becomes too slow when more complex pages must be rendered. To
achieve optimal processing speed as well as smoth and flicker free scrolling the viewer should
render the page into an image in the size of the scaled page format so that the finish image can be
scrolled. The background or the frame rectangle must be drawn by the viewer application in this
case.
To calculate the required image size in pixels the rendering engine provides helper functions to
access the page's bounding boxes as well as the page orientation fast as possible (see GetPageBBox()
and GetPageOrientation()).
 

Previous topic: Rendering PDF Pages

Next topic: The Transformation Matrix