function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Leo WangLeo Wang 

dispatch to a pdf page, but cannot save pdf with chrome!

two pages use the same controller, one is a general visual page and another is rendered as pdf.
when dispatch to the pdf page, I can see the pdf well, but cannot save the pdf with chrome while Firefox, Safari are ok.
bellow is some related code,
public PageReference newPage()
    {
        return Page.DownloadUnmatchedLeads;
    }



Thanks.
Best Answer chosen by Leo Wang
Ramu_SFDCRamu_SFDC
When you say you are able to save the pdf with Firefox and Safari and not from Chrome I assume that you are using the save buttons offerred by pdf applications on browsers. Chrome uses default pdf browser unlike other browsers, this might be the problem why you are not able to save only with Chrome while other browsers are working fine.

Below is the post that explains how you can change the default pdf viewer of Chrome to external pdf applications like adobe,foxit reader as all other browsers use.

https://productforums.google.com/forum/#!topic/chrome/qdsluD3m8IE

All Answers

Ramu_SFDCRamu_SFDC
When you say you are able to save the pdf with Firefox and Safari and not from Chrome I assume that you are using the save buttons offerred by pdf applications on browsers. Chrome uses default pdf browser unlike other browsers, this might be the problem why you are not able to save only with Chrome while other browsers are working fine.

Below is the post that explains how you can change the default pdf viewer of Chrome to external pdf applications like adobe,foxit reader as all other browsers use.

https://productforums.google.com/forum/#!topic/chrome/qdsluD3m8IE
This was selected as the best answer
Leo WangLeo Wang
Thanks, Ramu_SFDC. and, is there a way to download automatically when click the pdf page link in salesforce, not display the pdf page? I prefer to stay on the page.
Ramu_SFDCRamu_SFDC
Hi Leo Wang, to my knowledge it is not possible to give a download link directly from visualforce as we are not storing the data in any location. We are dynamically rendering the data as pdf format at which point the control is taken over by PDF viewer softwares like adobe, foxit or inbuilt pdf reader apps.  In case you would like to give a download button, I guess we first need to store the pdf file at some location and dynamically generate the link of the location which when clicked will give an option to save or open which are once again browser specific.

I came across the below post which talks about a similar requirement. I suggest that you try it out once to see if that works.

https://developer.salesforce.com/forums/ForumsMain?id=906F000000098ZWIAY

Hope this helps !!
Leo WangLeo Wang
big thanks, Ramu.
East KenEast Ken
I found a guide on create PDF (http://www.rasteredge.com/how-to/csharp-imaging/pdf-creating/), hope it will give you some ideas on sloving your issue.
Best regards.