Some test text!

Add a new PDF Layer

To add a PDF layer in a new document.

PDFDoc doc = new PDFDoc();
ElementBuilder builder = new ElementBuilder(); // ElementBuilder is used to build new Element objects
ElementWriter writer = new ElementWriter(); // ElementWriter is used to write Elements to the page

// Create a layer
Group image_layer = Group.Create(doc, "Image Layer");
Config cfg = Config.Create(doc, true);
cfg.SetName("Default");

// Start a new page ------------------------------------
Page page = doc.PageCreate();
writer.Begin(page); // begin writing to this page

// Add new content to the page and associate it with the layer.
Element element = builder.CreateForm(CreateGroup1(doc, image_layer.GetSDFObj()));
writer.WriteElement(element);
doc.PagePushBack(page);

// Set the default viewing preference to display 'Layer' tab.
PDFDocViewPrefs prefs = doc.GetViewPrefs();
prefs.SetPageMode(PDFDocViewPrefs.PageMode.e_UseOC);

PDF layers (OCG)
Full sample code which demonstrates how to create, extract, render PDF layers.

Get the answers you need: Support