Importing and Exporting XFDF From PDF Using iText Java API

View: New views
2 Messages — Rating Filter:   Alert me  

Importing and Exporting XFDF From PDF Using iText Java API

by Snehajeevi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I have a Requirement where i want to Import XFDF or FDF data from a PDF and Export it to another PDF.

The code Snippet for Import is working fine

PdfReader pdfreader = new PdfReader("PDFwithComments.pdf");
                PdfStamper stamp = new PdfStamper(pdfreader, new FileOutputStream("PDFwithoutComments.pdf"));
                FdfReader fdfreader = new FdfReader("PDFwithComments.fdf");
                AcroFields form = stamp.getAcroFields();
                form.setFields(fdfreader);
                stamp.close();

But I didnt Find any iText API which does the Export of the XFDF or FDF data from a PDF.

Can Anyone give me some inputs Regarding this.

Regards
Snehajeevi.

Re: Importing and Exporting XFDF From PDF Using iText Java API

by venkifo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some modification in import code.

                        PdfReader pdfreader = new PdfReader("D:\\PDF_No_Comment.pdf");
                        PdfStamper stamp = new PdfStamper(pdfreader, new FileOutputStream("D:\\PDF_Comment.pdf"));
                   FdfReader fdfreader = new FdfReader("D:\\FDFdata1.fdf");
                 
                   stamp.addComments(fdfreader);
                        stamp.close();

Regards
Snehajeevi
LightInTheBox - Buy quality products at wholesale price!