Dear List,

 

Sorry, I sent this by mistake to list admin.

 

Is it possible to add a new OCG layer (with content) to an existing PDF
using PdfStamper?

 

This code adds a Page Resource Properties dictionary but no OCProperties
dictionary

 

        static void Main(string[] args)

        {

            Document document = new Document();

            PdfWriter writer = PdfWriter.GetInstance(document, new
FileStream("Stampee.pdf", FileMode.Create));

            writer.PdfVersion = PdfWriter.VERSION_1_6;

            document.Open();

            document.Add(new Paragraph("Hello World"));

            document.Close();

            PdfReader reader = new PdfReader("Stampee.pdf");

            PdfStamper stamper = new PdfStamper(reader, new
FileStream("Stamper.pdf", FileMode.Create));

            stamper.Writer.PdfVersion = PdfWriter.VERSION_1_6;

            BaseFont bf = BaseFont.CreateFont(

            BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);

            PdfLayer layer = new PdfLayer("one", stamper.Writer);

            PdfContentByte cbUnder = stamper.GetUnderContent(1);

            cbUnder.BeginLayer(layer);

            cbUnder.EndLayer();

            stamper.Close();

        }

 

Can I add content to an existing layer, using PdfStamper?

 

Thanks

AlanK

 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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