aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes regarding pdf Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "regarding pdf" Watch "regarding pdf" New topic
Author

regarding pdf

santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 115
hi

I am using doing one project in that i want to show report as pdf, I was using content type as application/pdf in page directive but it did not work please tell me how to display jsp as pdf.


Thanking You.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56233
    
  13

Read ⇒ ItDoesntWorkIsUseless, and provide more information.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 115
hi

I was using <% page contentType="application/pdf" %> but it is opening in browser, I was using struts iterator tag and bean:write tag.


Thanking you.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56233
    
  13

What did you expect it to do? What do you have your browser configured to do?
santhosh kumar vk
Ranch Hand

Joined: Aug 25, 2009
Posts: 115
hi

I am using code like struts <logic:iterator> and <bean:write> in jsp it will show some collection it is opening in browser but it should open in pdf how to open
please tell me.

Thanking You.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56233
    
  13

What you are using (Struts, and so on) is irrelevant. The browser will handle the PDF in that manner in which it was configured to do so.

The only other control you have over the situation is setting the content-disposition header. Search for information on that header and see if you can get the behavior you want. If not, then it's a matter of browser configuration.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

You'll also want to actually output PDF. I get the feeling that you are outputting HTML and expecting something at the client side to display that in PDF format. It doesn't work that way.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56233
    
  13

Hmmm, good point Paul.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35258
    
    7
Also, JSPs are not suitable for handling binary content (like PDFs) - you need to use a servlet instead.


Android appsImageJ pluginsJava web charts
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Paul Clapham wrote:It doesn't work that way.

It does here:

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: regarding pdf
 
Similar Threads
Generate pdf file using Servlets
Div inner Html to PDF
Can I read already pdf file
How can I print my pdf file to printer using swt and save the pdf file
Creating a file from Various chunks of different files in java