DynaPDF Manual - Page 631

Previous Page 630   Index   Next Page 632

Function Reference
Page 631 of 818
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.
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
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()).
The image size can be calculated as follows (C++):

Previous topic: Rendering PDF Pages

Next topic: The Transformation Matrix

Start Chat