Skip to main content
The 2024 Developer Survey results are live! See the results
15 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 ...
Mike's user avatar
  • 754
10 votes

Render Visualforce page as PDF in landscape orientation

You have to use applyBodyTag="false" attribute in <apex:page tag as explained in Visualforce Developer Guide to render the PDF properly. I checked with the below code and I am able to render the ...
Saroj Bera's user avatar
  • 14.8k
10 votes
Accepted

Open PDF in browser instead of Downloading

This was actually solved by setting the pdf filetype to 'Execute in Browser' from Setup -> Security -> File Upload and Download Security
G Takei's user avatar
  • 193
10 votes
Accepted

How to generate a PDF and have it download from a Lightning Web Component

You can use download.js to implement this functionality. The main idea is to convert the PDF into Base64 encoded String and pass it to the download method of download.js. Which will show the file ...
Saroj Bera's user avatar
  • 14.8k
9 votes
Accepted

Visualforce PDF : how to display footer on ALL pages?

I finally resolve my problem by putting the <div class="footer"><some footer here</div> BEFORE the content of my page. This way I can see the footer on all the pages. If any of you know ...
dou's user avatar
  • 1,959
9 votes
Accepted

Visualforce RenderAs PDF not supporting SLDS CSS

It is a common assumption that the HTML to PDF engine presently used by Salesforce is Flying Saucer that only supports version 2.1 of CSS (W3C Recommendation 07 June 2011) whereas SLDS is designed to ...
Keith C's user avatar
  • 137k
7 votes
Accepted

Barcodes generation for VF PDF reports

I have personally written a barcode component that works with PDF. It's actually pretty easy. The actual component is self-contained: <c:barcode codeValue="12345" /> Edit: Please be ...
sfdcfox's user avatar
  • 497k
7 votes
Accepted

Collection size 1.079 exceeds maximum size of 1.000

Adding readOnly="true" to the Visualforce page should fix your problem as explained in Setting Read-Only Mode for an Entire Page. Note that this will raise the limit from 1,000 to 10,000 so ...
Keith C's user avatar
  • 137k
6 votes

Why am I not able to get full 60 second CPU time in @future method with getContentAsPDF()

getContentAsPDF actually internally performs a callout back into Salesforce as a new transaction. This means that the actual CPU time used for the primary transaction doesn't account for the time used ...
sfdcfox's user avatar
  • 497k
6 votes
Accepted

Preview PDF file on visualforce page

I have used the object tag to display a PDF static resource so I assume this will work for your PDF link: <object data="{!linkToPdfFile}" width="100%" style="height: 500px; ...
Keith C's user avatar
  • 137k
6 votes
Accepted

Generate PDF with REST Web service

See getContentAsPDF() after insert a record in the same excution context that explains that the PDF generation call won't see any changes made in the transaction that calls it. If you don't require ...
Keith C's user avatar
  • 137k
6 votes
Accepted

css trouble using visualforce renderas PDF

I think it is because of this: font-family: Arial Unicode MS; If you replace it with: font-family: sans-serif; It should work ok. From Wikipedia: ....it (sic) contains Roman (upright) glyphs ...
Phil Hawthorn's user avatar
6 votes
Accepted

Visualforce <style> tag outputting as text in PDF

The renderer only accepts style formats in the head section of the page: <apex:page StandardController="Project__c" extensions="projectToPDFController" renderAs="pdf" ...
sfdcfox's user avatar
  • 497k
6 votes
Accepted

Issue in PDF generation of a LWC component in Visualforce

The PDF renderer does not support JavaScript, but Aura and LWC components are always loaded via JavaScript. That means it is impossible to use renderAs to render an Aura Component or LWC component in ...
sfdcfox's user avatar
  • 497k
5 votes
Accepted

how to include image as header/logo in a visualforce pdf page

have u tried with @top-center ? like : @top-center { content: "Sample Header Test"; background-image: url('{!$Resource.YOUR_IMAGE}'); } You can use other way for reducing image size like : ...
Arjun Khatri's user avatar
  • 1,338
5 votes

Visualforce page rendered PDF shows a strange error,

Remove the development mode toolbar by clicking on the X or whatever closes it on the right side of the bar. It can mess with things
Eric's user avatar
  • 54.2k
5 votes
Accepted

≤ not displayed in vf page, renderAs pdf

Update and complete solution for pdf rendering with Special characters If the PDF file fails to display all the page’s text, particularly multibyte characters such as Japanese or accented ...
Santanu Boral's user avatar
5 votes
Accepted

Save base64 data as Attachment

Did you set the contentType as application/pdf? I tried this following code and it is working for me. String jsonStr = '<Base64 String>'; Attachment attach = new Attachment(); attach....
Saroj Bera's user avatar
  • 14.8k
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 ...
sfdcfox's user avatar
  • 497k
5 votes
Accepted

How to control the page size of the PDF generated from Visualforce page

Specify the page size using the CSS size attribute. <style> @page { margin: 0.25in; size: 4in 4in; } </style> You won't find this in the standard Salesforce documentation, but the ...
sfdcfox's user avatar
  • 497k
5 votes
Accepted

How to display downloaded PDF blob in an iframe?

You have to alter your getPDF() method and prepend data:application/pdf;base64, public String getPDF() { return 'data:application/pdf;base64,'+EncodingUtil.base64Encode([SELECT VersionData ...
Pranay Jaiswal's user avatar
5 votes
Accepted

How to get past the URL limit error of maximum 4096 characters?

There are a few options, but basically you need to get the bulk data out of the query string. Typically you would do this by using a POST request rather than a GET request. Since a PageReference ...
Daniel Ballinger's user avatar
4 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 ...
TheArchitecta's user avatar
4 votes

Render PDF Blob data in visualforce page

Although this post is old, I came across the same problem and found a solution. As @jkraybill mentioned above, Visualforce will not emit binary data. This means we can't retrieve a Blob from ...
Wes Lyons's user avatar
  • 346
4 votes
Accepted

Can we generate PDF in ExactTarget?

Your best bet would be to generate the PDFs outside the platform. I suppose you could build a Script Activity that uses some sort of JS library (like referenced in this post) to generate the PDF ...
Adam Spriggs's user avatar
  • 30.8k
4 votes
Accepted

How do I get a line break in a Visualforce page IF formula?

Rather than trying to do everything in a large formula you can break it up into several controls. Before: <apex:page renderAs="PDF" standardController="Account"> {!IF(Account....
Daniel Ballinger's user avatar
4 votes

Render Visualforce page as PDF in landscape orientation

Post-API version 27, you need to have the <html> tag in your VF page for @page { size: landscape } to work, plus you'll need to apply applyHtmlTag="false" to the apex:page tag. So your code ...
Delphine's user avatar
  • 183
4 votes

Visualforce PDF : how to display footer on ALL pages?

I think you almost got it but missed two minor things. You mentioned applyHtmlTag="false" but there is no HTML tag in the code. You have div tag for footer but there is no content inside it. Try add ...
javanoob's user avatar
  • 8,907
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> ...
Adrian Larson's user avatar
  • 151k
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 ...
Carlos Naranjo's user avatar

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