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

DynaPDF Manual - Page 255

Previous Page 254   Index   Next Page 256

Function Reference
Page 255 of 750
// 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);
CreateOCMD
Syntax:
SI32 pdfCreateOCMD(
const PPDF* IPDF,
// Instance pointer
TOCVisibility Visibility, // When should the OCMD be visible?
UI32* OCGs,
// Array of OCG handles (required)
UI32 Count)
// Number of handles in the array (required)
typedef enum
{
ovAllOff,
ovAllOn,
ovAnyOff, // Default
ovAnyOn,
ovNotSet
// Internal (defaults to ovAnyOn if used)
}TOCVisibility;
The function creates an Optional Content Membership Dictionary (OCMD). OCMDs can be used to
create visibility expressions which depend on more than one optional content group.
OCMDs are mostly used with Annotations and Form Fields because these objects can only be
associated with one OCG or one OCMD. In cases where the visibility should depend on more than
one OCG or if the object should be used in different layers, an OCMD must be used.
The parameter Visibility specifies when the associated objects should become visible. The parameter
OCGs must be an array of valid OCG handles. A viewer application inspects the array of OCGs and
the visibility parameter to determine whether the associated content should be visible or invisible.
 

Previous topic: How to make content optional?

Next topic: CreateRadialShading