Q : We are testing “PDFNet” and I have the following (programming) question:
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”)
Can you tell me how, if possible, I can set this print-property for the created group?
The relevant section in ISO 32000 PDF Reference is 22.214.171.124, “Usage and Usage Application Dictionaries”.
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”);
// Obj v = usg.PutDict(“View”);
// v.PutName(“ViewState”, “OFF”);