Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 724

Previous Page 723   Index   Next Page 725

Function Reference
Page 724 of 767
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: SetTextFieldValue

Next topic: SetTextScaling