> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Ignacio Ruiz-de-Conejo > Sent: Tuesday, February 13, 2007 3:52 PM > To: itext-questions@lists.sourceforge.net > Subject: [iText-questions] Removing layers from a PDF > > 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. >
There's no security in it. The data is still there and can be accessed and modified given the right tools. > The question now is: is there a way, with iText, of > accessing/modifying this OCG ? There's nothing done in iText to do that although it's really not rocket science. Paulo Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------- 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/