Hot answers tagged

4 votes
Accepted

Visualforce Page: How to display all the content/data in a single VF PDF page

I don't think you can force it to just a single page. However, you can define a custom page size - and make it big enough that you never get a page break. Something like this: @page { size: 8.5in ...
Caspar Harmer's user avatar
3 votes
Accepted

Is it possible to call a LWC from Apex?

No, you can't execute JavaScript from Apex (at least, not without Functions). If you're trying to render a PDF on-demand, and it's not standard PDF rendering engine, you'll need to callout to another ...
sfdcfox's user avatar
  • 481k
3 votes
Accepted

Charts in Visualforce generated PDFs in early 2023

What worked for me... Using external sites that generate images of charts based on URL parameters remains IMHO the simplest approach. Even the nominally deprecated Google Image Charts is still running....
Keith C's user avatar
  • 135k
2 votes
Accepted

Trouble loading PDF.js lib in LWC

When you do loadScript you need to point it to the .js file in your static resource, not just the folder name. For example, instead of loadScript(this, pdfjs), you need to do loadScript(this, pdfjs + &...
fred's user avatar
  • 2,783
1 vote

AppExchange to generate PDF of a record

Depending on your use case, you can likely do this without an app by creating a custom Visualforce page using renderAs="pdf". https://developer.salesforce.com/docs/atlas.en-us.pages.meta/...
Jerry Woods's user avatar
1 vote
Accepted

How to generate e PDF in Apex from a VFP containing multiple aura components and attach it to an email

Per the Visualforce doc, PDF rendering is not supported if content is rendered by Javascript PDF rendering doesn’t support JavaScript-rendered content. You might need to refactor your Aura ...
cropredy's user avatar
  • 70k
1 vote

Visualforce CORS Error Even When Origin Is Whitelisted, Headers Are Also Set

I faced the same issue, so the workaround is to get the base64 blob value of the document from ContentVersion and call pdfjsLib.getDocument(). Check this https://mozilla.github.io/pdf.js/examples/
Rahul Boinepally's user avatar
1 vote

I want to add image on Visualforce PDF but i cant change its size

apex:outputField has some extra layers between the field and the style, which is causing problems. Try something like: <style> div.squareImage { display: inline-block; } div.squareImage img { ...
sfdcfox's user avatar
  • 481k
1 vote

Visualforce pdf - only show footer on even pages

**The reason the footer was displaying with incorrect content is because we have to specify a footer (even if it's a blank one). I guess when you use running:footer, it will take the default footer if ...
Tom's user avatar
  • 153

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