I'm stumped by a very strange issue. We have Lightning enabled in Production and sandboxes.

I have an Action (on Opportunity object) which points to a Visualforce page. The Visualforce page is rendered as PDF (using renderAs="pdf").

Now this works fine and well in the Sandbox i.e. Visualforce page opens up as a PDF, but in Production it just opens the Visualforce page without rendering it as a PDF file.

<apex:page showHeader="false" sidebar="false" renderAs="pdf" standardcontroller="Opportunity" extensions="GuaranteeDocumentController">
<p><apex:image style="margin-right: auto; margin-left: auto; display: block;" url="{!$Resource.GuaranteeDocumentPic1}" alt="" width="116" height="108"/></p>
<p><apex:outputText value="{!GuaranteeDocumentText1}" escape="false"/><apex:outputField value="{!Opportunity.Account.Name}"/><apex:outputText value="{!GuaranteeDocumentText2}" escape="false"/></p>
    <apex:outputField value="{!Opportunity.PrimarySigner__r.FirstName}"/><apex:outputText value="{!GuaranteeDocumentText3}" escape="false"/><apex:outputField value="{!Opportunity.PrimarySigner__r.LastName}"/><apex:outputText value="{!GuaranteeDocumentText4}" escape="false"/><apex:outputField value="{!Opportunity.Account.Name}"/>
    <apex:outputText value="{!GuaranteeDocumentText5}" escape="false"/><apex:outputField rendered="{!NOT(ISNULL(Opportunity.SecondarySigner__c))}" value="{!Opportunity.SecondarySigner__r.FirstName}"/><apex:outputText rendered="{!NOT(ISNULL(Opportunity.SecondarySigner__c))}" value="{!GuaranteeDocumentText6}" escape="false"/><apex:outputField rendered="{!NOT(ISNULL(Opportunity.SecondarySigner__c))}" value="{!Opportunity.SecondarySigner__r.LastName}"/>
    <apex:outputText rendered="{!NOT(ISNULL(Opportunity.SecondarySigner__c))}" value="{!GuaranteeDocumentText7}" escape="false"/><apex:outputField rendered="{!NOT(ISNULL(Opportunity.SecondarySigner__c))}" value="{!Opportunity.Account.Name}"/>
    <br/><apex:outputText value="{!GuaranteeDocumentText8}" escape="false"/><br/>
    <apex:image style="margin-right: auto; margin-left: auto; display: block;" url="{!$Resource.GuaranteeDocumentPic2}" alt="" width="129" height="38"/><br/>
    <apex:image style="margin-right: auto; margin-left: auto; display: block;" url="{!$Resource.GuaranteeDocumentPic3}" alt="" width="403" height="22"/>

EDIT: Alright so seems like this is a browser issue in Microsoft Edge. Any ideas why Edge doesn't render the visualforce as a pdf?

  • 2
    You sure it has same code in production as well as sandbox, try running the page in incognito mode.
    – Raul
    Jan 2 '19 at 15:09
  • 2
    You are using static resources $Resource can you see if you have same in sandbox? Jan 2 '19 at 15:10
  • 2
    Are the browsers used same across instances? Jan 2 '19 at 15:10
  • 2
    Yes, the code and static resources are exactly the same (VF + Controller). @codeyinthecloud Seems like you caught it. When I tested this across browsers, it is in Microsoft Edge that the PDF rendering doesn't work properly. In Chrome it is working fine. So seems like browser issue. Any idea how to fix it for Edge?
    – kt10208
    Jan 3 '19 at 8:27

Based on comments looks like the browser is the culprit here. Try looking at the requirementsfor the supported versions and if you’re able to reproduce the issue, It’s time to raise a case with support

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.