DynaPDF Manual - Page 773

Previous Page 772   Index   Next Page 774

Function Reference
Page 773 of 839
#define E_VALUE_ERROR
0x08000000
#define E_FONT_ERROR
0x10000000
#define E_FATAL_ERROR
0x20000000
#define E_FILE_ERROR
0x40000000
At time of publication only one flag is set at any one time. Future versions may be set multiple flags,
e.g. E_SYNTAX_ERROR and E_WARNING. Because of this, it is recommended to mask out the
error type with a bitwise and operator.
If the callback function returns a value other than zero (0), processing stops immediately.
Return values:
If the function succeeds the return value is 1. If the function fails the return value is 0.
SetOnPageBreakProc
Syntax:
LBOOL pdfSetOnPageBreakProc(
const PPDF* IPDF,
// Instance pointer
const void* Data,
// User defined pointer or NULL
const void* OnBreakProc) // Callback function, see below
#define PDF_CALL __stdcall
// Windows only, otherwise empty
typedef SI32 PDF_CALL TOnPageBreakProc(
const void* Data,
// User defined pointer
double LastPosX,
// Last x-coordinate of the string
double LastPosY,
// Last y-coordinate of the string
LBOOL PageBreak);
// True, if a manual page break occurred
The function sets a callback function which is called by WriteFText() when a page break occurred.
The parameter Data holds a user defined pointer which is passed unchanged to the callback
function. If this pointer is not required set it to NULL. The calling convention of the callback
function is standard call on Windows.
The Visual Basic and VB .Net interfaces use events instead of a callback function, see Language
Binding Visual Basic or VB .Net for further information). In VB .Net you can use a callback function
or the event. The OnPageBreakProc event must be connected manually in these interfaces to avoid
different runtime behaviour of the function WriteFText(). To enable the event call the function
ConnectPageBreakEvent() in VB or VB .Net.
The parameter PageBreak of the callback function specifies why the callback function was called:
If true, a page break tag in the string was found (see WriteFText() for further information).
If false, the output rectangle was filled with text entirely.
The usage of the callback function is described in detail under WriteFText(). However, the following
return values of the callback function can be used the change the text alignment:
#define NEW_ALIGN_LEFT
1
#define NEW_ALIGN_RIGHT
2
#define NEW_ALIGN_CENTER
3
#define NEW_ALIGN_JUSTIFY 4
 

Previous topic: SetOCGState, SetOnErrorProc

Next topic: SetOpacity, SetOrientation