Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 498

Previous Page 497   Index   Next Page 499

Function Reference
Page 498 of 750
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.

Previous topic: Color Key Masking

Next topic: IsWrongPwd