+ Start a Discussion
jordanmjordanm 

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

Hi

 

I think you need to render a page as pdf

<apex:page id="thepage" standardController="Account" extensions="testComponent" renderAs="PDF">
{!acc.id}
</apex:page>

 

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

jordanmjordanm

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}"/>
        </apex:panelGrid>
</apex:page>
Hannes.EHannes.E

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}"  />
</apex:page>

 

jordanmjordanm

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

 

case#07570728

Hannes.EHannes.E

Salesforce says the Support Manager is on this now.

VruVru

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

 

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

 

Error:
PDF generation failed. Check the page markup is valid.

 

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

 

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

 

jordanmjordanm

Great, thank you!

Starz26Starz26

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.

Michael_TorchedloMichael_Torchedlo

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