aspose file tools*
The moose likes Other Open Source Projects and the fly likes Problem in Downloading PDF link in HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Problem in Downloading PDF link in HTML" Watch "Problem in Downloading PDF link in HTML" New topic
Author

Problem in Downloading PDF link in HTML

Vishal Baid
Ranch Hand

Joined: Jul 18, 2012
Posts: 42
    
    1
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Jul 18, 2012
Posts: 42
    
    1
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

Joined: May 25, 2009
Posts: 296

You need to let the servlet set the "Content-Disposition" header to "attachment"


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
Vishal Baid
Ranch Hand

Joined: Jul 18, 2012
Posts: 42
    
    1
How can I do this in XSL-FO ?
For creating and designing PDF We are using XSL-FO.
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

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

Joined: Jul 18, 2012
Posts: 42
    
    1
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

Joined: May 25, 2009
Posts: 296

Try this


The Link
Vishal Baid
Ranch Hand

Joined: Jul 18, 2012
Posts: 42
    
    1
Sumit Patil wrote:Try this


The Link


Hi Many Many Thanks.
Problem is solved now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Downloading PDF link in HTML