.pdf files created by a servlet don't open in the browser, but with a linux pdf viewer
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   liliyaw_woland
Posted On:   Thursday, March 30, 2006 11:11 AM

Please help, The code I'm testing - a servlet - works fine in Windows OS. A servlet creates a pdf file in a .jsp page. But the same on linux opens up a pdf viewer for the created .pdf file. THis is the code I'm using: Pdf p = new Pdf(req.getParameter("pdfFile")); ServletOutputStream out = resp.getOutputStream(); resp.setHeader("Content-Type", "application/pdf"); resp.setHeader("Content-Disposition", "inline; filename="" + pdfOut + """); ByteArrayOutputStream ba = new ByteArrayOutputStream(); p.writeToStream(ba); resp.setContentLength(ba.size()); ba.writeTo(out); out.flush();    More>>

Please help,
The code I'm testing - a servlet - works fine in Windows OS. A servlet creates a pdf file in a .jsp page. But the same on linux opens up a pdf viewer for the created .pdf file. THis is the code I'm using:

Pdf p = new Pdf(req.getParameter("pdfFile"));
ServletOutputStream out = resp.getOutputStream();
resp.setHeader("Content-Type", "application/pdf");
resp.setHeader("Content-Disposition", "inline; filename="" + pdfOut + """);
ByteArrayOutputStream ba = new ByteArrayOutputStream();
p.writeToStream(ba);
resp.setContentLength(ba.size());

ba.writeTo(out);
out.flush();

   <<Less

Re: .pdf files created by a servlet don't open in the browser, but with a linux pdf viewer

Posted By:   Almagest_FUTT  
Posted On:   Thursday, March 30, 2006 05:30 PM

About | Sitemap | Contact