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
SFDC Admin 21SFDC Admin 21 

Visualforce Page rendered as PDF not displaying in Salesforce1 App.

Hi Fellow Developers,

I have created a visualforce page which I'm rendering as PDF. The page header looks like this:

<apex:page Standardcontroller="Opportunity" extensions="RFController" standardStylesheets="False" showHeader="False" sidebar="False" cache="True" renderAs="PDF" docType="html-5.0" contentType="application/pdf">

The page displays perfectly in the standard Salesforce org.

However if I try to display the same page in the the Salesforce1 App by calling the page from a custom button on Opportunity with content source set as the Visualforce page, the page doesn't render and the animated circular fetch gif keeps moving. Screenshot below:

User-added image

The page never loads. 

Additional Info: I also tried the same thing by creating an empty Visualforce page, with renderAs="PDF" but to no avail.

I also noticed when I press the back arrow on the app, the pdf shows for a fraction of a second and the view shifts back to the Opportunity record.

Please help out if anyone has a clue about this. Thank you very much

Justin ManchesterJustin Manchester
Hello,

I did a little testing with this and it appears to break for me only if you include the "standardStylesheets" attribute.
I would say to try removing this and give it a shot. Let me know how that works out for you. 

Cheers,
Justin

SFDC Admin 21SFDC Admin 21
Nope, doesn't work for us on removing the standardStylesheets or setting it to false either. But it does work if we use window.open to redirect to our vf PDF page.

Any idea why this might happen ?
 
İrem Günerİrem Güner
 Hi, we exactly have the same issue. Did you find out any solution on this? Regards
Hirdesh GangilHirdesh Gangil
Hi , i have an issue with rendering as pdf in mobile but my pdf is shown in vf page , i want to do this for same as mobile , 
so please let me know the work around of this...