I want to set the property “print” of a group to “Never print”.
I have created the group (layer) by your examplecode, see code below:
Dimdoc As PDFDoc= New PDFDoc("d:\Temp\TestOCG.pdf")
Dimcfg As Config= doc.GetOCGConfig()
DimhiddenGroup As Group= CreateLayer(doc, "doHidden")
PrintState entry in Print dictionary (which is part of Optional Content Usage Dictionary) should be set to ‘OFF’.
The Usage dictionary is optional entry in OCG (Optional Content Group) dictionary.
For example, you could try the following:
Obj usg = hiddenGroup.GetSDFObj().PutDict("Usage");
Obj prn = usg.PutDict("Print");
prn.PutName("PrintState", "OFF");
...
// Obj v = usg.PutDict("View");
// v.PutName("ViewState", "OFF");
...