Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: IE6,Servlet,FDF kit for Java(??not retrieves in browser)
Conf: (P-PDF) Developers, Msg: 92315
From: sgho
Date: 7/18/2003 02:15 AM

Please share the thoughts if you had luck before in successfully retrieving pdf (with fields populated with retrieved values) using FDF tool kit for Java, Servlet, within a browser(IE 6.0)? I am using Tomcat 4.1.24.

I am having problem in retrieving pdf with populated fields within a browser IE 6.0, SP1 using FDF Tool Kit for Java, Java 1.4, Tomcat 4.1.24 with Adobe 5.0 on Windows 2000 platform.

However, if I open the same pdf file within Adobe Acorobat (full blown software), I can successfully retrieve the pdf file with populated fields.

A button in pdf hits doPost method of Servlet. It works fine if I open the pdf within Adobe and it successfully retrieves pdf file with data.

When I open the same pdf file within a browser (IE), it still hits doPost method of Servlet. I can see debugging statements inside doPost method. It does not throw any exception in Tomcat, or in the browser. However, a new pdf page with the retrieved values for fields is not shown/displayed in the browser. It does NOT open up/retrieve the pdf file with retrieved values. It keeps the same/previous pdf file in the browser.

I am doing a cut-paste of Servlet code. There is a retrieve button on pdf page. Pdf page also has a field called IRB. When retrieve button on pdf is clicked, following doPost method gets triggered.

---------------------------------------------------------
package com.core;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import com.adobe.fdf.*;

public class Retrieve extends HttpServlet
{
public void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
try
{
FDFDoc outputFDF = null;
outputFDF = new FDFDoc();

//I have tried both the lines individually as shown below.
// I have saved the same file as pdf and fdf. But no luck
// I have fdf version of the pdf file at the same location

//outputFDF.SetFile
//("http://localhost:8081/sickle/PDF/myfile.fdf");

outputFDF.SetFile
("http://localhost:8081/sickle/PDF/myfile.pdf");

// I am trying to populate a field named "IRB" in myfile.pdf
outputFDF.SetValue("IRB", "val_IRB");

//response.setDateHeader("Expires", 0);
//response.setHeader("Cache-Control", "no-store, no-cache");
//response.setHeader("Pragma", "no-cache");

response.setContentLength(999999999);
response.setContentType("application/vnd.fdf");

//response.setHeader("Content-
//Disposition", "inline;filename=myfile.fdf");

response.setHeader("Content-
Disposition", "attachment;filename=myfile.fdf");

OutputStream out = response.getOutputStream();
outputFDF.Save(out);
out.close();
}
catch (Exception e)
{ e.printStackTrace(); }
}
}
------------------------------------------------
Should I be only using pdf, or fdf version of pdf in the code?

Some other folks have accomplished the same task of retrieval using PHP and FDF tool kit for PHP in IE 6.0. I duplicate the PHP code in Java - still no luck.

Does anyone know about any strange behavior related to IE6.0, Java and FDF tool kit for Java?


Regards,
Sam
sgho@aol.com


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.