+ Start a Discussion

After update several hours ago renderAs PDF doesn't seem to be working?

It won't even work for the canned quote2PDF example in the cookbook...


I get this error message on an otherwise blank failure page: "PDF generation failed. Check the page markup is valid. "


Anyone else seeing this?

Abhay AroraAbhay Arora



I think you need to render a page as pdf

<apex:page id="thepage" standardController="Account" extensions="testComponent" renderAs="PDF">


Above is what i have used and it works can you post your code so that i can test?


Here is a very basic example. I use quote__c as the standard controller but you can make it tie to any generic CRM object to test. I'm only using organization fields, a style sheet, and an image.


The commented lines point to a staticresource zip. Something in the summer '12 upgrade changed the way these tags are processed because commenting them out leads to the pdf rendering. Adding them in brings up that strange error message.


<apex:page standardController="Quote__c" showHeader="false" renderAs="pdf">
        <!--<apex:stylesheet value="{!URLFOR($Resource.pdfresource, 'styles.css')}"/>-->
        <!--<apex:image value="{!URLFOR($Resource.pdfresource, 'logo.gif')}"/>-->
        <apex:panelGrid columns="1" styleClass="companyTable" width="100%">
            <apex:outputText value="{!$Organization.Name}" styleClass="companyName"/>
            <apex:outputText value="{!$Organization.Street}"/>
            <apex:outputText value="{!$Organization.City}, {!$Organization.State} {!$Organization.PostalCode}"/>
            <apex:outputText value="{!$Organization.Phone}"/>

We are having the same error on CS7 and CS14, using the image tag + rendering as PDF.


<apex:page renderAs="PDF">
	<apex:image id="headerImage" value="{!$Resource.HeadLogo}"  />



stylesheets don't work either. you can reference them without error but none of the css actually makes it to the rendered output




Salesforce says the Support Manager is on this now.


All, We are currently investigating this as a potential product issue with Summer'12.


PDF creation fails only when you have a VF page that contains a static resource reference.


PDF generation failed. Check the page markup is valid.


Example snippet:
//<apex:page renderAs="PDF">
//<apex:image url="{!$Resource.ichiro}"/> <br/>


I'll update this thread as we have more information.



Great, thank you!


Wow, I just spent 3 hours trying to trouble shoot  a page a third party developer made and when I realized they were catching exceptions and not displaying them I added the code and found this error. Then realized our sandbox was upgraded to Spring 12 and came here......


I hate wasting time!!


Please let us know when this is fixed.....


FYI: We do have another PDF generated page that is working but one that is not.


I am experiencing this exact error on our custom VF pages, but our org also happens to use the standard Salesforce.com Quotes feature.  There seems to be a problem with the Create PDF aspect of this tool (which does not use any custom VF).  When I try "Create PDF" I get either an internal server error or a garbled Quote Template.  Are these two issues related?

Richie DRichie D

Salesforce are aware of this problem; due to summer 12 upgrade of sandboxes - http://success.salesforce.com/issues_view?id=a1p30000000Rr87AAC