DynaPDF Manual - Page 671

Previous Page 670   Index   Next Page 672

Function Reference
Page 671 of 818
content of the page is placed on an intermediate medium, such as film or an imposed reproduction
In the latter case, it is important to distinguish between the intermediate page and the finished page.
The intermediate page may often include additional production-related content, such as bleeds or
printer marks that falls outside the boundaries of the finished page. To handle such cases, a PDF
page can define as many as five separate boundaries to control various aspects of the imaging
A bounding box is defined as rectangle giving the coordinates of a pair of diagonally opposite
corners. The media box of a page is normally expressed in a normalized form where the coordinates
of the lower-left point are set to zero.
A normalized bounding box can be easily defined as follows:
pdfSetBBox(pdf, pbMediaBox, 0, 0, 612, 792);
The parameters RightX, RightY represent the width and height of the media box (this is the paper
format if no crop box is present). The media box should normally be defined in the normalized form
because the bounding box defines also the coordinate origin of the page. Predefined paper formats
can also be set with the function SetPageFormat().
It is also possible to change the bounding box of a template or pattern with this function. These
object types support the media box only; the other bounding boxes are ignored. Note that the
coordinates of the objects inside a page, template or pattern depends on the coordinate origin of the
media box.
The crop box crops the page as the name suggests. The crop box represents also the paper format if
If the width of a bounding box is less than 1 unit the function deletes the bounding box from the
object. The media box is required, it cannot be deleted.
The minimum page size is 3 x 3 Units; the maximum is 14,400 x 14,400 Units. The minimum size of a
template or pattern is 1 x 1 Units and the maximum is 14,400 x 14,400 Units.
If a page with more than 14,400 Units should be created then it is possible to scale the page format
with SetUserUnit(). A User Unit is an additional scaling factor that is used to calculate the page
format. This makes it possible to create extremely large page formats without exceeding the limits of
the page coordinate system.
No bounding box of a page should be larger than the media box.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.

Previous topic: SetAnnotSubject, SetBBox

Next topic: Bounding boxes:, SetBidiMode

Start Chat