9 votes
Accepted

Programmatically generate Quote PDF in Lightning Component Apex controller

I've found a solution by experiment (with a hat tip to @KeithC, who got me speculating on a productive path), but I don't understand why it works/the direct path doesn't work. I would be happy to ...
David Reed's user avatar
  • 92.6k
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

Regex including curly brackets

Since backslashes are the escape character in Apex string literals, if you want a literal backlash, you need to escape it with a backslash. So the right regex to use would be \\{.*\\}
Derek F's user avatar
  • 60.9k
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
  • 487k
4 votes
Accepted

PageReference.GetContentAsPDF throws Internal Salesforce.com Error

If you add renderas="pdf" to the page, getContent will return a PDF of the page, and appears to still correctly throw an ExecutionException when the page throws an error (including uncatchable ...
IllusiveBrian's user avatar
4 votes

Programmatically generate Quote PDF in Lightning Component Apex controller

The getContentAsPDF call operates in a separate transaction. So if you make that call from within the transaction that sets up the data, that getContentAsPDF call will not see the data at all as the ...
Keith C's user avatar
  • 136k
3 votes
Accepted

Get content of local Visualforce Page from managed package code

Rendering an unmanaged page from within a Managed Package requires that you specify the default namespace within the page url. I would imagine that this is because by default, the platform is trying ...
Phil Hawthorn's user avatar
3 votes

Border CSS not working properly with VF page rendered as pdf

The PDF engine that Salesforce still use AFAIK is Flying Saucer and that is far behind current CSS standards including to my knowledge not supporting rounded borders. So I'm afraid you will have to ...
Keith C's user avatar
  • 136k
3 votes

Page getContent / getContentAsPDF not retrieving the updated data

This has been answered before but I can't find a good example. The problem is that the getContentAsPdf call does not see the changes made because it runs in a separate transaction and the current ...
Keith C's user avatar
  • 136k
2 votes

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

Its salesforce native functionality if you are familiar with salesforce CRM than whenever you create an invoice or quote under an opportunity than their is a button called create PDF to genrate ...
Amit Chaudhary's user avatar
2 votes

Salesforce VF - getContent() and getContentAsPdf() timeout

Adjusting the time out won't help you; you're presumably running in to the CPU governor limit if you've gone more than 10 seconds. Your only choice is to optimize your page and/or controller in order ...
sfdcfox's user avatar
  • 487k
2 votes
Accepted

Marketing Cloud Email Archival as PDF to FTP

There is really nothing you can do, to implement this natively in SFMC. My idea for such a solution would be following: Store the VAWP URL in sendlog. It will provide you with the web version of that ...
Lukas Lunow's user avatar
  • 21.1k
2 votes

Create Pdf from visualforce page with button

PageReference pdfPage2 = Page.pdfpage2; ... pdfBlob = pdfPage2.getContent(); This causes a new, separate instance of the controller to be loaded; it doesn't know about the variables in the original ...
sfdcfox's user avatar
  • 487k
1 vote

I want to pass collection variable to apex class

Invocable Apex is always implicitly bulkified Each element in the request corresponds to one Flow Interview Thus void pdfGeneratorTrialInitiation(List<ID> trialId) means that trialId[0] ...
cropredy's user avatar
  • 70.9k
1 vote

I want to pass collection variable to apex class

If you need to pass collection variable to apex class then you have to define List<List<id>> in your apex class as parameter for that method. If you want to pass just a single record or ...
SaiPraveen Kakkirala's user avatar
1 vote

How can we access visualforce page for pdf generation from a future annotated method

You are on the right path, grant the permission on either the Profile or Permission Set for the user to page 'pdfgeneratorpage' as Aditya mentioned.
Jeferson Chaves's user avatar
1 vote
Accepted

Trying to show PDF in Lightning web component in iFrame but it does not render the PDF file

solved this by making a change in the postmessage. Here's what I updated : this.template.querySelector('iframe').contentWindow.postMessage(this.pdfData, window.location.origin); I hope this helps ...
anxiousAvocado's user avatar
1 vote
Accepted

How can a VF page be attached to an email as a pdf attachment in landscape format?

You can apply landscape to the entire page using the @page CSS selector. Here is a fully functional version you can use as a starting point: <apex:page renderAs="advanced_pdf" showHeader=&...
sfdcfox's user avatar
  • 487k
1 vote
Accepted

Salesforce Visualforce Update Timing issue?

Since v34.0, both getContent and getContentAsPDF are treated as callouts. This means that a separate transaction is spawned, and the original is placed on hold. This is problematic, because it also ...
sfdcfox's user avatar
  • 487k
1 vote

Unknown Visualforce Error CompositeFont

Have you tried changing the font in the in-line CSS ? "style="font-family: 'Roboto', sans-serif;" Or recompiling the Apex class since that may be a java bug. https://bugs.openjdk.java.net/browse/JDK-...
Boris Gichev's user avatar
1 vote

Generating a PDF from a Lightning Page with LockerService restrictions

To get around LockerService restrictions you can use a VisualForce page and then you can create the components from lightning. See this question for info on how to host lightning components in ...
Aequitas's user avatar
  • 358
1 vote

Cache value not being saved in Org from Async call

Without seeing the design of your code, it's possible that either the results were not committed to the cache yet, the cache was invalidated for some reason, or the transaction exceeded the per ...
sfdcfox's user avatar
  • 487k
1 vote

How to change the design of the exported Excel or PDF files?

The reason your images aren't rendering is because they're not being uploaded as static resources. They can't be rendered to a PDF from an insecure link in they way you're attempting to it. ...
crmprogdev's user avatar
  • 40.9k
1 vote

displaying the vf page details as pdf

As far as I know, rendering a Visualforce page as a PDF is a big pain. Salesforce uses flying saucer as its PDF generator engine and it have very much limitations. Visualforce PDF Rendering ...
Vigneshwaran G's user avatar
1 vote
Accepted

displaying the vf page details as pdf

If you want to display VF page as pdf format then use renderAs Example.. <!-- Page: --> <apex:page renderAs="pdf"> <style> body { font-family: 'Arial Unicode MS'; } </style&...
Ratan Paul's user avatar
  • 22.6k
1 vote

Increase PDF height to show in one page

Try setting the page size in the <style> tag: <style> @page { size: 8.5in 11in; margin:0.0in; /* PDF width, height, margin */ } </style>
R Banks's user avatar
  • 11

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