Here is what worked for me. The PDF is created dynamically.
1. a small bit of code which used FOP and served it as a stream. Be sure to
set the response type.
byte[] fo;
.
.
.
InputSource fopInput = new InputSource( new ByteArrayInputStream( fo )
);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
Driver driver = new Driver( fopInput, outStream );
driver.setLogger(log);
driver.setRenderer(Driver.RENDER_PDF);
driver.run();
output = outStream.toByteArray();
response.setContentType("application/pdf");
response.resetBuffer();
response.setContentLength(output.length);
ServletOutputStream os = response.getOutputStream();
os.write(output);
os.close();
2. Also added to the URL at the end was the following:
&pdf=.pdf\
Can't remember where I found this idea, nor can I find it at this minute,
but it made it work.
hth,
Dave
-----Original Message-----
From: Jay Hulslander [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 6:17 AM
To: Tomcat Users List
Subject: Re: pdf not working
Just so I understand, file.jpg is hosted fine back to a browser. File.pdf,
in the same location, is not hosted back to the browser find. Is that what
you are experiencing? Sounds like tomcat is configured to "execute" pdf
documents as opposed to hosting them. Much like you would configure a web
server to execute streaming video as opposed to just hosting a video to be
downloaded. I do not know where this configuration is done in Tomcat, but
that is where I would start.
-Jay
At 06:04 AM 5/4/2005, you wrote:
>Hi all,
>
>Iam trying to call a link to a new window and that's calling a pdf
>document thats somewhere in my folder under webapps. The problem is
>that the pdf is not shown. If i try it with an image it will be
>displayed correctly. I am using Tomcat 5.5.
>
>Maarten
>--
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 3-5-2005
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]