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 ...
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 \\{.*\\}
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 ...
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 ...
6
votes
Accepted
PDF Generation Salesforce
What's your timeline? Winter 16 will allow getcontent from @future:
http://docs.releasenotes.salesforce.com/en-us/winter16/release-notes/rn_apex_pagereference_getcontent.htm
You can now make calls ...
4
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 ...
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 ...
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 ...
3
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 ...
3
votes
Accepted
How to mix getContentAsPDF calls with DML?
You're allowed a single queueable call per database execute method, so this code should technically work:
// Must use Database.AllowsCallouts for PDF generation
public with sharing class ...
2
votes
Accepted
GetContentAsPDF from Batch Apex and Trigger fails with new Update
With Winter`16 release it would be resolved. Partners says:
In the Winter '16 release, getContent() and getContentAsPDF() can be
invoked from within Asynchronous Apex such as Batch Apex, ...
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 ...
2
votes
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 ...
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 ...
2
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 ...
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 ...
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.
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 ...
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=&...
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 ...
1
vote
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 ...
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-...
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 ...
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 ...
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.
...
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 ...
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&...
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>
1
vote
How to mix getContentAsPDF calls with DML?
Based on sfdcfox's idea and code, I've just tried this and it works:
public class FireEventsBatchable implements Database.Batchable<Integer>,
Database.AllowsCallouts, Database.Stateful {...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
getcontentaspdf × 50visualforce × 28
apex × 18
pdf × 12
renderas × 5
future × 4
quote × 4
getcontent × 4
asynchronous × 3
lightning-web-components × 2
soql × 2
css × 2
attachment × 2
guest-user × 2
critical-update × 2
cache × 2
marketing-cloud × 1
lightning-aura-components × 1
trigger × 1
lightning × 1
javascript × 1
community × 1
rest-api × 1
email × 1
managed-package × 1