DynaPDF Manual - Page 184

Previous Page 183   Index   Next Page 185

Function Reference
Page 184 of 839
CalcPagePixelSize (Rendering Engine)
Sytax:
void rasCalcPagePixelSize(
IPGE* PagePtr,
// Page pointer
TPDFPageScale DefScale, // Scaling type
float Scale,
// Scaling factor (if DefScale = psFitZoom)
UI32 FrameWidth,
// Width of the output rectangle
UI32 FrameHeight,
// Height of the output rectangle
TRasterFlags Flags,
// Additional flags
UI32* Width,
// Out -> Image width in pixels (required)
UI32* Height)
// Out -> Image height in pixels (required)
The function calculates the image size of a page exactly in the way as RenderPage() does, if called
with the same parameters. This makes it possible to create the image in the required size so that it
can be rendered without a border.
CalcWidthHeight
Syntax:
double pdfCalcWidthHeight(
const PPDF* IPDF,
// Instance pointer
double OrgWidth,
// Original width of the image or template
double OrgHeight,
// Original height of the image or template
double ScaledWidth,
// Scaled Width
double ScaledHeight) // Scaled Height
This function calculates the scaled width or height of a given size in the same way as InsertImage()
or PlaceTemplate(). It can be used to calculate the new width or height of an image or template
before it will be inserted to the page.
If ScaledWidth == 0 and fabs(ScaledHeight) > 0 the function returns the scaled width with exact
proportions in relation to the given values of OrgWidth and OrgHeight.
If fabs(ScaledWidth) > 0 and ScaledHeight == 0 the function returns the scaled height with
exact proportions in relation to the given values of OrgWidth and OrgHeight.
The function uses the absolute values so that the parameters can be negative. The parameters
OrgWidth and OrgHeight must be greater zero.
Return values:
If the function succeeds the return value is unequal -1. If the function fails the return value is -1.
 

Previous topic: BuildFamilyNameAndStyle

Next topic: CaretAnnot