DynaPDF Manual - Page 747

Previous Page 746 Index Next Page 748

Function Reference

Page 747 of 777

The function replaces the contents of an XFA stream with new contents. Index must be a valid XFA

resource index. XFA streams can be enumerated with GetXFAStream() / GetXFAStreamCount().

The function does not check whether the provided XFA buffer is valid. The buffer is written to the

stream as is.

Return values:

If the function succeeds the return value is 1. If the function fails the return value is 0.

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.

Previous topic: SetWMFPixelPerInch, SetWordSpacing, SetXFAStream

Next topic: SortFieldsByIndex, SortFieldsByName, SquareAnnot