DynaPDF Manual - Page 172
Previous Page 171 Index Next Page 173
Function Reference
Page 172 of 839
pdfBeginLayer(pdf, oc1);
pdfBeginLayer(pdf, oc2);
pdfSetFont(pdf, "Arial", fsRegular, 12.0, true, cp1252);
char someText[] = "Some text with a link!!!";
pdfWriteText(pdf, 50.0, 50.0, someText);
double tw = pdfGetTextWidth(pdf, someText);
// To reflect the same nesting as the text layer we must
// use an OCMD for the annotation because the visibility of the
// layer oc2 depends on oc1 at this position.
pdfSetBorderStyle(pdf, bsUnderline);
pdfSetStrokeColor(pdf, PDF_BLUE);
SI32 annot = pdfWebLink(pdf, 50, 51, tw, 12, "www.dynaforms.com");
UI32 ocgs[2] = {oc1, oc2};
SI32
ocmd = pdfCreateOCMD(pdf, ovAllOn, ocgs, 2);
pdfAddObjectToLayer(pdf, ocmd, ooAnnotation, annot);
pdfEndLayer(pdf);
pdfBeginLayer(pdf, oc3);
InsertImageEx(pdf, 50.0, 70.0, 300.0, 200.0, "c:/Imgs/test.tif", 1);
pdfEndLayer(pdf);
pdfEndLayer(pdf);
pdfWriteText(pdf, 50.0, 300.0, "This text is not part of a layer!");
pdfEndPage(pdf);
pdfCloseFile(pdf);
BeginPageTemplate
Syntax:
LBOOL pdfBeginPageTemplate(
const PPDF* IPDF,
// Instance pointer
const char* Name,
// Template name
LBOOL UseAutoTemplates) // See description
The function creates a page template. A page template is an invisible page that can be added to the
document via Javascript.
Page templates are mainly used in Interactive Forms to dynamically add additional pages to the
document. A page template is like a normal page. You can add form fields and annotations to it but
no article beads (see AddArticle()) since a page template is not part of the document's page array.
The parameter Name is required, it must not be NULL or an empty string. The name can be used to
reference the template via Javascript.
Previous topic: BeginLayer
Next topic: BeginPattern, Colored Tiling Patterns, Uncolored Tiling Patterns