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

DynaPDF Manual - Page 708

Previous Page 707   Index   Next Page 709

Function Reference
Page 708 of 750
pdfSetFont(pdf, "Bookman Old Style", fsBold, 80, true, cp1252);
// We want to draw an axial shading into the clipping path
SI32 sh = pdfCreateAxialShading(pdf, 0, 50, 0, 130, 1, PDF_BLUE,
PDF_YELLOW, false, false);
// Do not forget to save the graphics state
pdfSaveGraphicState(pdf);
pdfSetTextDrawMode(pdf, dmClipping); // Use the text as clipping path
pdfWriteText(pdf, 50, 50 - (80 - pdfGetCapHeight()), "Clipping");
pdfApplyShading(pdf, sh);
// Restore the graphics state now to disable the clipping path
pdfRestoreGraphicState(pdf);
EndPage(pdf);
pdfCloseFile(pdf);
pdfDeletePDF(pdf); // Do not forget to delete the PDF instance
return 0;
}
Output:
SetTextFieldValue
Sytnax:
SI32 pdfSetTextFieldValue(
const PPDF* IPDF,
// Instance pointer
UI32 Field,
// Text field handle
const char* Value,
// Field's value or NULL
const char* DefValue, // Field's default value or NULL
TTextAlign Align)
// Text alignment
The function sets or changes the value and default value of a text field. The parameters Value and
DefValue can both be NULL, if both values should be deleted. The parameter DefValue defines the
default value of the field, this value is shown in Adobe's Acrobat as long as the field has no value; it
will be hidden when entering the field.
The strings are drawn with the font that is associated with the field. The font size is taken from the
field settings. If set to “auto”, the font size is computed from the field’s bounding box.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. Because interactive form
fields do not support Unicode, the strings must contain characters which are defined in the code
page 1252 or MacRoman.
 

Previous topic: How to use text as clipping path?

Next topic: SetTextRect