14 votes

Status of renderAs advanced_pdf

As of Summer '18, this pilot program has been cancelled. The service didn't quite meet the scalability goals we needed. Safe harbor, we're working on a way to bring the program back and adapt it to ...
user avatar
  • 714
10 votes
Accepted

External Image Link Broken when Rendering as PDF

I just figured this out after 30 minutes of Googling and thought a concise post may help others in future. It was not documented in the SFDC documentation but was on an different post from 2012. Is ...
user avatar
10 votes
Accepted

How to add page breaks to visual force page rendered as pdf so that a dynamically rendered list in apex repeat tag does not strech the table lines

I found an easy solution for the problem, no need to implement any logic for the same just included the following attribute -fs-table-paginate: paginate; in tables style tag and worked like a miracle.
user avatar
7 votes
Accepted

renderas PDF page level styles not working with v30.0 api

Maybe you can wrestle with the machine that is the PDF output builder. For styling to work in that API version, the page will need to look more like this: <apex:page showHeader="false" ...
user avatar
5 votes
Accepted

Question regarding default Salesforce client certificate being retired

Steven Lawrence from Salesforce answered me on November 14 about this, at the Salesforce Success Community Group about Salesforce Infrastructure. His answer was: Fortunately, this change does not ...
user avatar
5 votes
Accepted

Image inside hyperlink not working in Visualforce page rendered as PDF

I got it to work on my system by going with pure html: <a href="https://www.xyz.com"> <img src="{!$Resource.icon}" alt="icon"/> </a>
user avatar
  • 12.2k
5 votes
Accepted

Visualforce Page renderAs pdf styling does not apply

CSS transforms are not supported in PDF mode. Also, anything that starts with "-moz", "-ms", "-o", or "-webkit" are not supported. You'll have to find a CSS1- or CSS2-level support design that meets ...
user avatar
  • 434k
5 votes

Show value in Outputfield and InputFIeld while Rendered

Yes, it should work as written, although for efficiency, you should write it as follows: rendered="{!AND(Boolean1, NOT(Boolean2))}" rendered="{!AND(Boolean1, Boolean2))}" There's no need for the IF ...
user avatar
  • 434k
4 votes

How to add page breaks to visual force page rendered as pdf so that a dynamically rendered list in apex repeat tag does not strech the table lines

What you want to do typically requires a custom controller. There's an excellent tutorial in the Technical Library titled Creating Professional PDF Documents with CSS and Visualforce that describes ...
user avatar
  • 40.4k
4 votes

how to make the link active in pdf when we render the visual force page as PDf?

If you look at the documentation for <apex:commandLink>, you will see that the action parameter invokes a server method using AJAX. You can't use Javascript in a PDF. The <apex:outputLink> ...
user avatar
  • 143k
4 votes
Accepted

Protect a generated PDF

You can create a Username - Password step before allowing anyone to download your PDF. If you inform the user that he can download a PDF after inserting a Username and Password you can do something ...
user avatar
4 votes
Accepted

Javascipt component not coming render as pdf

Refer this document: Visualforce PDF Rendering Considerations and Limitations. Don’t use standard components that aren’t easily formatted for print, or form elements such as inputs or buttons, or any ...
user avatar
  • 17.7k
4 votes
Accepted

Remote Objects do not work when rendered as PDF?

According to this article: PDF rendering doesn’t support JavaScript-rendered content.
user avatar
  • 1,503
4 votes

renderAS = "advanced_pdf" with API Version 46.0 not rendering PDF with SDLS framework

Advanced PDF is - as far as I'm aware - not yet GA and still in Pilot. Source: https://releasenotes.docs.salesforce.com/en-us/summer17/release-notes/rn_vf_advanced_pdf.htm There have been no ...
user avatar
  • 1,976
4 votes
Accepted

My visualforce PDF does not render webp image

PDF does not support webp, and Flying Saucer, the PDF renderer for Salesforce (and other programs), does not support webp; it would need to translate the webp file into a JPEG file to be usable in PDF....
user avatar
  • 434k
3 votes
Accepted

Styles code appearing when page rendered as pdf

Use the <apex:page> attribute applyBodyTag="false".
user avatar
3 votes
Accepted

Render whole div in one page using renderAs PDF

This should work for you: @media print { div{ page-break-inside: avoid; } }
user avatar
3 votes
Accepted

RenderAs PDF with Bootstrap

In the bootstrap css file change the relative paths to the glyphicons fonts to some CDN e.g. change ../fonts/glyphicons-halflings-regular.eot to https://cdnjs.cloudflare.com/ajax/libs/twitter-...
user avatar
  • 66
3 votes
Accepted

Render page as PDF, after the JS executions is complete

The engine that generates PDF in Salesforce does not support JavaScript and neither does the PDF format itself so anything drawn into the page by JavaScript won't make it through to the PDF. PDFs ...
user avatar
  • 130k
3 votes

Wrapping link in TD tag in Visualforce render as PDF page

Here is a similar solution posted in dev forum. Hope this helps. I have copied the solution here. private String addWhiteSpaceInUrlTooLong(String text) { // Step 1 - Search anchor links ...
user avatar
3 votes

Stop blank page being created (because of page break setting) at end of visualforce rendered as pdf

The suggestion from How to deal with page breaks when printing a large HTML table seems applicable: Note: when using the page-break-after:always for the tag it will create a page break after the ...
user avatar
3 votes

Print/Download PDF from VF Renderas=PDF in Lightning Experience

Print & download option comes from the browser's pdf viewer. If you still want to have a button somewhere in your org to download the page, have the button, onclick of which redirect the user to ...
user avatar
3 votes
Accepted

Visualforce renderAs="PDF" header <a> tag doesn't wrap <img>

align is deprecated attribute for img tag in HTML5 and renderAs PDF is pretty strict with HTML/CSS guidelines, quoting from MDN web docs: Aligns the image with its surrounding context. Use the ...
user avatar
  • 17.7k
3 votes

Visualforce renderAs Pdf CSS selector issue [:last-child]

:last-child was introduced as part of CSS 3. The library that Salesforce leverages to turns Visualforce pages into .pdf files, Flying Saucer, only supports up to CSS 2.1 (which is when :first-child ...
user avatar
  • 48.4k
2 votes

Getting "PDF generation failed. Check the page markup is valid." Error from tables?

Edited to be more like an answer. There could be many answers to this problem. Ultimately "Check your css!" I received this error earlier today and isolated right down to a height tag in my CSS ...
user avatar
2 votes

Attach dynamic PDF to email in Approval Process

You need to create a visualforce email template. Also change your existing VF page to apex:component Then include that in the messaging:attachment inside VF-Email template. See : Adding attachments ...
user avatar
2 votes
Accepted

font color not working for Apex renderas PDF page

You can write your css style inside the style tag which is wrapped inside an HTML tag, and also make sure your "applyBodyTag="false"" is set in your apex:page. <apex:page renderAs="pdf" ...
user avatar
  • 1,415
2 votes

Last trailing blank PDF page gets added, need to remove

I also once gone through it, and done with following solution. Try this out. <apex:variable var="cnt" value="{!0}" /> <apex:repeat value="{!cases}" var="cse"> <!-- apex:...
user avatar
2 votes
Accepted

Status=Unauthorized, StatusCode=401

You're making life hard for yourself there by using a Rest Service. Why not simply use PageReference().getContentAsPDF()? example: global class AccountTriggerController{ @Future(callout=true) ...
user avatar
2 votes

Header Image in Visualforce PDF

Was able to successfully render an image in the header with the following: <apex:page standardController="Opportunity" renderAs="pdf" applyBodyTag="false" standardStylesheets="false"> &...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible