Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- PDF generation failed. Check the page markup is va...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
PDF generation failed. Check the page markup is valid.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-14-2012 02:44 PM
I have a VF page that is being populated via a standard controller.
It works fine when all my child lines in the controller are specified.
If my controller does not return anything ( in the example - No contact role assigned to the opportunity object ) I have the 'PDF generation failed. Check the page markup is valid.' error.
From browsing the forum, I can see that I need to use the Rendering method, either in the <apex:repeat /> or <apex:outputField />, but i have not been able to find in which order nor which synthax.
Would you be able to get me an insight?
Below is the summarised version of my VF Page:
<apex:page standardController="Opportunity" showHeader="false" renderas="pdf" extensions="BSL_Layout_LinkOppLines" >
<apex:stylesheet value="{!$Resource.CSS_GeneratePDF}"/>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
<td align="left"><font face="Arial" >
<h2><b>{!Opportunity.Name}</b></h2></font>
</td>
</tr>
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Contact Roles / Value Chain Member</font></b></p>
<table border="0" width="100%" id="table4">
<tr>
<td bgcolor="#C0C0C0"><font face="Arial">Contact</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Account</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Phone</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Role</font></td>
</tr>
<tr>
<apex:repeat value="{!OpplineContactRole}" var="lineContact">
<tr>
<td><apex:outputField value="{!lineContact.ContactId}"/></td>
<td><apex:outputField value="{!lineContact.Contact.AccountId}"/></td>
<td><apex:outputField value="{!lineContact.Contact.Phone}"/></td>
<td><apex:outputField value="{!lineContact.Role}"/></td>
</tr>
</apex:repeat>
</tr>
</table>
</apex:page>And here is my Extension Class:
public class BSL_Layout_LinkOppLines{
public List<OpportunityContactRole> OpplineContactRole{get;set;}
public BSL_Layout_LinkOppLines(ApexPages.StandardControll er controller){
OpplineContactRole=[select Id, OpportunityId, ContactId, Role, Contact.AccountId, Contact.Phone
from OpportunityContactRole
where OpportunityId =:(ApexPages.CurrentPage().getParameters().get('id '))];
}
}
Thanks
Solved! Go to Solution.
Re: PDF generation failed. Check the page markup is valid.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-14-2012 06:26 PM
<apex:page standardController="Opportunity" showHeader="false" renderas="pdf" extensions="BSL_Layout_LinkOppLines" >
<apex:stylesheet value="{!$Resource.CSS_GeneratePDF}"/>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
<td align="left"><font face="Arial" >
<h2><b>{!Opportunity.Name}</b></h2></font>
</td>
</tr>
</table>
<br/>
<hr/>
<p><b><font color="#000080" face="Arial">Contact Roles / Value Chain Member</font></b></p>
<table border="0" width="100%" id="table4">
<tr>
<td bgcolor="#C0C0C0"><font face="Arial">Contact</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Account</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Phone</font></td>
<td bgcolor="#C0C0C0"><font face="Arial">Role</font></td>
</tr>
<apex:repeat value="{! OpplineContactRole}" var="lineContact">
<tr>
<td><apex:outputField value="{!lineContact.ContactId}"/></td>
<td><apex:outputField value="{!lineContact.Contact.AccountId}"/></td>
<td><apex:outputField value="{!lineContact.Contact.Phone}"/></td>
<td><apex:outputField value="{!lineContact.Role}"/></td>
</tr>
</apex:repeat>
</table>
</apex:page>
// i have change the value apex repeat and removed one tr. if it is solution please mark as solution thanks
Hit the Kudos button (star) if any post helps you - Mark the answer as solution, It might help others running to into similar problem in future.
Re: PDF generation failed. Check the page markup is valid.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-14-2012 07:10 PM
Hi,
It works great.
Thanks a lot for that.
Regards, Yoann.

