application/vnd.fdf not displaying in remote browser
843836Sep 2 2003 — edited Sep 2 2003Hi,
I was hoping someone could help me or point me to a topic that would. I didn't find what I needed after searching.
I'm using Adobe's FDF Toolkit to build an fdf and send it to the browser.
I have set my contentType to application/vnd.fdf and when I test it locally it works fine. I have both Acrobat Pro and Adobe Reader on my box and it uses Acrobat to open the resulting pdf.
When I go to a remote box that only has Adobe Reader on it, the request for the pdf is submitted, Reader starts up, then displays a blank page.
if I change it to just application/fdf, the browser doesn't know what to do with it right away and asks if you want to save or open it, if you choose open, then Adobe Reader displays the pdf correctly.
i want to get this to work with the vdn.fdf setup since if I do just fdf, it asks you what you want to do and opens up a reader window, the displays the pdf in the browser. The reader window stays around.
Does anyone have any ideas why it wouldn't work remotely?
Thanks,
Chris
I'm inserting my code below:
public class AdobeTestAction extends Action {
/**
* Constructor
*/
public AdobeTestAction() {
super();
}
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ActionForward forward = new ActionForward();
AdobeTestForm adobeTestForm = (AdobeTestForm) form;
String date = GregorianCalendar.getInstance().getTime().toString().replace( ' ', '_' ).replace( ':', '_' );
try {
FDFDoc fdf = new FDFDoc();
fdf.SetValue( "borrowerName", adobeTestForm.getBorrowerName() );
... more SetValues()
fdf.SetFile( "http://myServer/myPath/myPDF.pdf" );
response.setContentType( "application/vnd.fdf" );
ServletOutputStream out = response.getOutputStream();
fdf.Save( out );
}
catch ( Exception e ) {
System.out.println( e.toString() );
}
return null;
}