DynaPDF Manual - Page 559

Previous Page 558   Index   Next Page 560

Function Reference
Page 559 of 839
How to calculate the image size?
The calculation of the image size should be easy as possible. In most cases, images must be inserted
with exact proportions. Therefore, all image functions support two special values to make the
calculation easier. The width and height can be calculated as follows:
If ScaleWidth or ScaleHeight is -1 the function uses the original width or height from the
image. If both parameters are -1 the image will be inserted with a resolution of 72 DPI.
If ScaleWidth or ScaleHeight is 0, the missing value is calculated in relation to the given value
of ScaleHeight or ScaleWidth to preserve the image's aspect ratio. The resulting output is an
image with exact proportions relative to its original size.
If ScaleWidth and ScaleHeight are 0, the original size is used (same effect as -1).
A negative value of Width or Height mirrors the image on the x- or y-axis.
It is possible to use one image on several pages or positions. To insert an image multiple times use
the function PlaceImage(). However, once an image was inserted, the physical dimension cannot be
changed; it can only be scaled to different sizes. If an image should be used with different
dimensions, insert the largest version first.
Return values:
If the function succeeds the return value is the image handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
SI32 pdfIsBidiText(
const PPDF* IPDF,
// Instance pointer
const UI16* AText) // Unicode string
The function returns the position of the first bidirectional character that can be found in the string or
-1 if no such character can be found.
SI32 pdfIsColorPage(
const PPDF* IPDF,
// Instance pointer
LBOOL GrayIsColor) // Treat gray as color
This function checks whether a page is a color page or if all graphic elements of the page use black &
white only. If the parameter GrayIsColor is true, gray shades are treated as color. The page which
should be checked must be opened with the function EditPage() beforehand.

Previous topic: Color Key Masking

Next topic: IsEmptyPage, IsWrongPwd