DynaPDF Manual - Page 719

Previous Page 718   Index   Next Page 720

Function Reference
Page 719 of 777
To create a true landscape paper format the page's coordinate system must be rotated into the
opposite direction. This can be done with SetOrientationEx(). Another way to create a landscape
paper format is to change the bounding box of the page, see SetBBox().
Default value = 0 // Portrait
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
LBOOL pdfSetOrientationEx(
const PPDF* IPDF, // Instance pointer
SI32 Value)
// Orientation of the page
The function changes the orientation of a page, incl. important page properties such as the width and
height, and the coordinate system. The parameter Value must be a multiple of 90 or 0. Positive values
rotate the page clockwise, negative values counter clockwise.
The zero point of the coordinate system is set to the upper left or down left point depending on the
current page coordinate system (top down or bottom up).
When using a landscape paper format the functions GetPageWidth() and GetPageHeight() return the
logical width and height of the page. While the real paper format is not changed the functions return
the paper format as if the page would have a landscape paper format (the width and height are
The coordinate system is also changed so that you can work with the page as if it were not rotated.
Form fields and annotations are automatically rotated with the page; there is no need to rotate them
Pages which are rotated with this function appear in a viewer application always in the right
orientation. Also if the page is rotated, e.g. by 180 degrees the page is shown as if it were not rotated.
Since landscape or rotated paper formats require a changed coordinate system, care must be taken
into account if further coordinate transformations must be applied. DynaPDF makes sure that one
transformation can be applied without causing errors, e.g. rotating or translating the coordinate
system, but coordinate transformations must not be nested.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: SetOpacity, SetOrientation

Next topic: SetPageBBox, SetPageCoords