DynaPDF Manual - Page 808

Previous Page 807   Index   Next Page 809

Function Reference
Page 808 of 839
SkewCoords
Syntax:
LBOOL pdfSkewCoords(
const PPDF* IPDF, // Instance pointer
double alpha,
// Angle alpha in degrees
double beta,
// Angle beta in degrees
double OriginX,
// Origin of the x-axis
double OriginY)
// Origin of the y-axis
The function skews the coordinate system and sets the coordinate origin to the point OriginX,
OriginY. It is highly recommended to save the graphics state beforehand, otherwise it is very
difficult or impossible to restore the coordinate system later.
After the coordinate system was changed by the function, bottom-up coordinates are active. It is not
possible to use top-down coordinates with a skewed coordinate system.
Skewing is internally calculated as follows:
TCTM M; // Transformation matrix, the data type is declared in dynapdf.h
M.a = 1.0;
M.b = tan(alpha / 180 * PI);
M.c = tan(beta
/ 180 * PI);
M.d = 1.0;
M.x = OriginX;
M.y = OriginY;
Because the tangent of the angles alpha and beta represent the skewed coordinate system, the angles
must not be 90, 180, 270, or 360 degrees.
Remarks:
If the graphics state was not saved beforehand the function sets a warning but the transformation is
applied.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0. Use an error
callback function or check whether an error occurred with the function GetErrorMessage(). See
Exception handling for further information.
Skewing:
 

Previous topic: SetWordSpacing, SetXFAStream

Next topic: SortFieldsByIndex, SortFieldsByName, SquareAnnot