pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajeev Menon <rajeevrmen...@gmail.com>
Subject Force download of FDF file in Internet Explorer
Date Tue, 28 Oct 2014 14:33:14 GMT
Hi,

I am populating a PDF file by creating a FDF file and sending it to the
browser. The FDF file has the url of the PDF that it should open to fill
the data. The file opens fine inside the browser (inline), but when I want
to force it to open with acrobat reader, it just shows a white page in the
reader. Here is the relevant code.

response.setContentType("application/pdf");
response.setHeader("Content-disposition","attachment;
filename=\"somefile.fdf\"");

            output.println("%FDF-1.2");
            output.println("1 0 obj <<");
            output.println("/FDF <<");
            output.println("/F(https://servername/sample.pdf)");

            output.println("/Fields[");
            output.println("<</T(FieldName1)/V (Hello World)>>");
            output.println("]");
            output.println(">>/Type/Catalog");
            output.println(">>");
            output.println("endobj");
            output.println("trailer");
            output.println("<</Root 1 0 R>>");
            output.println("%%EOF");

            output.flush();
            output.close();

Please let me know if I am missing something here. I implemented the PDF
form filling using both the PDFBox and the FDF approaches, but I am
experiencing some issues with the PDFBox.

Thanks,
Rajeev.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message