Hello,

Working with documents that contain sensible data, I wanted to display all
the information on the screen, but hide some parts of the docs when printing
them. I implemented that by importing the original pages and generating new
docs with OCG, that would not show, but overprint (and hide) the desired
information, as the following code suggests:

           PdfContentByte cb = writer.DirectContent;
           while (i < number_of_pages)
           {
             document.NewPage();                      // copy the page in
the new doc
             PdfImportedPage page1 = writer.GetImportedPage(reader, i);
             cb.AddTemplate(page1, 1f, 0, 0, 1f, 0, 0);
             PdfLayer layer = new PdfLayer("layer", writer);   // add a new
layer
             layer.SetPrint("Print", true);                    // that
overprints
             layer.OnPanel = false;                            // but is
not in panel
             layer.On = false;                                 // nor
displayed
             cb.BeginLayer(layer);
             cb.AddImage(jpeg);                                // image
overprinting
            // ...extra contents here
            cb.EndLayer();
         }

For security, the OCG (layer) is not displayed in the layers panel of
Acrobat, and can“t be accessed or modified.

The question now is: is there a way, with iText, of accessing/modifying this
OCG ?

Thanks,
   Ignacio
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to