I need some help with trying to fill out pdf forms with fdf data.  I'm
starting from scratch and taking it step by step and I keep getting this
error:

http://www.boston.com/globe/acrobat/today.pdf not found as file or resource.

I get this when I use my pdf form, or just any pdf file. Any ideas?  This is
a web application that I'm creating with a Java Servlet. (I just put in any PDF to see if it would work)
 
Am I going in the right direction?  I can't find any help or examples if filling out pdf forms with fdf data (merging) using Java.


Code:

            res.setContentType("application/pdf");
            File outputFile = new File("testfile.pdf");
            outputFile.createNewFile();
            PdfReader reader = new
            PdfReader("
http://www.boston.com/globe/acrobat/today.pdf");
            FileOutputStream stream =  new FileOutputStream(outputFile);

            PdfStamper stamp = new PdfStamper(reader, stream);
            AcroFields form = stamp.getAcroFields();
            form.setField("Line", "Line 1");
            form.setField("Name", "John Doe");
            form.setField("City", "Durham");
            form.setField("State", "NC");
            stamp.setFormFlattening(true);
            stamp.close();

 
 
Eric Vandervort
Applications Analyst/Programmer
Administrative Information Systems
University Of North Carolina at Chapel Hill
Phone: (919) 962-9894
Email: [EMAIL PROTECTED]
Visit My Homepage at http://www.unc.edu/~ericv

Reply via email to