Hot answers tagged

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
  • 734
14 votes
Accepted

My Header and Footer overlaps with the content in a PDF Visualforce Page

I think the main issues is that you should put your margin measurements in the @page element and remove them from the content div. For readability, i've put this all in one VF page: <apex:page ...
Phil Hawthorn's user avatar
12 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 ...
S Morgan Robertson's user avatar
11 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.
Aditya Sagam's user avatar
11 votes

How to repeat HTML table header (thead) for each page rendersAs pdf

Inside your CSS in tables style tag, you need to add the following attribute: table { -fs-table-paginate: paginate; } puts a header at the start of each new page where a table crosses a page ...
crmprogdev's user avatar
  • 40.8k
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.3k
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 Controls -> File Upload and Download Security
G Takei's user avatar
  • 193
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
  • 134k
8 votes
Accepted

visualforce PDF - content overlapping with header

Here is my modified version of the Visualforce page from Adding page header/footer into a VisualForce page rendered as PDF. As you have done, I've added applyBodyTag="false" to the apex:page element ...
Daniel Ballinger's user avatar
8 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,879
8 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.3k
7 votes

Download Invoice PDF's On List View without saving to Notes and Attachment as a zip file

Kudos to @SFDCGOD for suggesting this. I was so intrigued by his suggestion, I gave it a try. First, I created resources for each of the Javascript files (FileSaver.js and jszip.js) and then created ...
Phil Hawthorn's user avatar
7 votes
Accepted

How would I create a PDF in salesforce on any object WITHOUT using ANY code

This is a salesforce native functionality. Just add Create PDF button in Invoice Layout. Added Images for your reference. As you don't mention previously that you want to use it for all object then ...
Tushar Sharma's user avatar
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
  • 468k
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
  • 134k
6 votes
Accepted

PDF Attachment send by email and become a PDF.HTML

It seems that Salesforce converts attachment to html links when total size exceeds 3Mb. This is very annoying. Source 1 Source 2
brovasi's user avatar
  • 5,605
6 votes
Accepted

How to format currency in a visualforce page rendered as a PDF?

The <apex:outputText> can be formatted along with <apex:param>. <apex:outputText value="{0, number, $#,###.##}"> <apex:param value="{!Goal__c.Quarterly_Goal__c}"/> </...
Vigneshwaran G's user avatar
6 votes
Accepted

Batch Apex and performance

The batch apex is complete asynchronous process and it will execute in its own thread and hence it will not impact any data flow of your salesforce other process unless your other process depend on ...
Mohith Shrivastava's user avatar
6 votes
Accepted

Download Invoice PDF's On List View without saving to Notes and Attachment as a zip file

You can do following to achieve this: Add following javascript in your page FileSaver.min.js Blob.js jszip.min.js Pass All Id's to controller and just get there data by getContetnAsPdf one by ...
ashishcloud's user avatar
  • 1,040
6 votes
Accepted

pageBlockTable - row number variable is not incremented

The dataTable and pageBlockTable elements do weird things for content outside of apex:column elements (usually by way of ignoring the content entirely). If you put the counter inside a column, it will ...
sfdcfox's user avatar
  • 468k
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
  • 468k
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
  • 468k
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
  • 468k
5 votes
Accepted

too many nested getContent calls?

Since you are using getContent() method in the constructor and calling the same page with same controller again from constructor, it causes recursive execution. You will have to change the creation ...
Victor's user avatar
  • 3,581
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>
martin's user avatar
  • 12.5k
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,328
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
  • 53.7k
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

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
  • 134k

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