Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Downloading PDF link in HTML

 
Vishal Baid
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys

Today I was working on creating PDF. I created PDF Successfully. After that I try to download it. It was not asking for Save or open option in pop-up. It is directly opening in new tab of browser.
But I want to download it.

This link is like this

<a href="avc.pdf">PDF</a>

Please help me guys.

Thanks in Advance
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your browser is set up to open the pdfs up in the browser.

You can configure your server to force the save dialog: http://www.thingy-ma-jig.co.uk/blog/06-08-2007/force-a-pdf-to-download


Eric
 
Vishal Baid
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we have any other way ?
i don't want to change in setting of server.
If we can We change in code.

Please help me on this.
Thanks
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to let the servlet set the "Content-Disposition" header to "attachment"
 
Vishal Baid
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I do this in XSL-FO ?
For creating and designing PDF We are using XSL-FO.
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not used XSL-FO. The above statement was if you were using some servlet to render the pdf file. The relevant code would be



As per this site, in the "Initial Document Section", you can add headers. Please try that, although i am not sure if it will help.
 
Vishal Baid
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sumit Patil wrote:I have not used XSL-FO. The above statement was if you were using some servlet to render the pdf file. The relevant code would be



As per this site, in the "Initial Document Section", you can add headers. Please try that, although i am not sure if it will help.


I done this but the problem remain same for me.
Kindly Advice on this. Is their any other way to do this ?
 
Sumit Patil
Ranch Hand
Posts: 296
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this


The Link
 
Vishal Baid
Ranch Hand
Posts: 42
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sumit Patil wrote:Try this


The Link


Hi Many Many Thanks.
Problem is solved now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic