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 \\{.*\\}
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 ...
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 ...
4
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 ...
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 ...
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 ...
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 ...
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 ...
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
Accepted
getContentAsPDF() from batch Apex request works in scratch org but not production
Salesforce support was able to help me by pointing out that my profile had "Session Security Level Required at Login" set to High Assurance which forces MFA. High Assurance blocks processing ...
1
vote
Accepted
Guest User is generating and inserting Blank PDF through VF Page
So the problem was on the URL. I was using for the pageReference
Page.vfPageName;
for site guest users we will have to use the site URL for pageReference
earlier I tried to use :
pageRef = new ...
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
Blank PDF Generated on Use of getContentAsPDF on A VF Page When Called From an LWC Component on a Community Site
The way I've gotten around this is with Platform Events.
Create a Platform Event that the Guest user has access to create. Then, create a trigger (after insert) on the Platform Event, and from there ...
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] ...
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
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
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
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>
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
getcontentaspdf × 54visualforce × 28
apex × 23
pdf × 12
future × 4
quote × 4
renderas × 4
getcontent × 4
asynchronous × 3
trigger × 2
soql × 2
community × 2
rest-api × 2
batch × 2
visual-workflow × 2
visualforce-component × 2
css × 2
critical-update × 2
cache × 2
marketing-cloud × 1
lightning-aura-components × 1
lightning × 1
lightning-web-components × 1
javascript × 1
email × 1