You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Maarten Janssen <ma...@bedrijven.nl> on 2005/05/04 12:04:38 UTC

pdf not working

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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: pdf not working

Posted by Michael McQuade <m....@sympatico.ca>.
I have the exact opposite of your problem,   and I have no idea why mine
works,  I want to display a PDF file in the Browser Window from a list of
documents..... It may be JPG, DOC, BMP, PDF, whatever......  And then I want
to be able to VIEW the document FULL SCREEN, and send it out to WORD,  or
ADOBE, etc, depending on the document type.....

A JPG or BMP  will display in my Browser when selected successfully and go
out to a separate window (I.E.)   successfully if I hit VIEW FULL SCREEN....

a  PDF, will NOT display in my current browser window,  but if I hit VIEW
full screen it will go out to Adobe Reader,   which is what I want it to
do....  I made NO changes to Tomcat to make this happen.....

Mike


----- Original Message ----- 
From: "Maarten Janssen" <ma...@bedrijven.nl>
To: "Tomcat User List" <to...@jakarta.apache.org>
Sent: Wednesday, May 04, 2005 6:04 AM
Subject: pdf not working


> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: pdf not working

Posted by "David B. Saul" <db...@comcast.net>.
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:jdh34@cornell.edu] 
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: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: pdf not working

Posted by Jay Hulslander <jd...@cornell.edu>.
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: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: pdf not working

Posted by Maarten Janssen <ma...@bedrijven.nl>.
hI.

I am using internet explorer. The problem is when I open it as a file system
file (i.e. d:\etc..\x.pdf) it works.
But a relative path to a folder in my webapps it is NOT working.

Maarten

-----Oorspronkelijk bericht-----
Van: Parsons Technical Services [mailto:parsonstechnical@earthlink.net]
Verzonden: woensdag 4 mei 2005 13:20
Aan: Tomcat Users List
Onderwerp: Re: pdf not working


What browser are you using?

Doug


----- Original Message -----
From: "Maarten Janssen" <ma...@bedrijven.nl>
To: "Tomcat User List" <to...@jakarta.apache.org>
Sent: Wednesday, May 04, 2005 6:04 AM
Subject: pdf not working


> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.3 - Release Date: 3-5-2005

--
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: pdf not working

Posted by Parsons Technical Services <pa...@earthlink.net>.
What browser are you using?

Doug


----- Original Message ----- 
From: "Maarten Janssen" <ma...@bedrijven.nl>
To: "Tomcat User List" <to...@jakarta.apache.org>
Sent: Wednesday, May 04, 2005 6:04 AM
Subject: pdf not working


> 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: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org