Questions tagged [getcontentaspdf]
It returns a visualforce Page Reference in PDF form - base64 encoded binary data
54 questions
0
votes
0
answers
91
views
Generating PDF from Quote - No output via Flow
We utilize a third-party program to generate Quote PDFs - "Quote Editor". It uses VF pages as templates to do so. This works quite well using its native functionality (but this requires ...
0
votes
1
answer
121
views
I am trying to create an agreement using transient document in adobe sign using rest api.Following is my code snippet:
List<ContentVersion> cvList = [SELECT VersionData, Title FROM ContentVersion WHERE Id = '068OD00000137hmYAA'];
String boundary = '----WebKitFormBoundary' + String.valueOf(Crypto....
1
vote
1
answer
227
views
Guest User is generating and inserting Blank PDF through VF Page
Facing an issue when generating a PDF through the VF page from a Guest User but for the same code from the System Admin Profile, it's getting generated and inserted successfully.For the guest user, ...
0
votes
0
answers
118
views
Cannot render pdf file in contentdocument in PDFjs viewer using salesforce URLs
I am creating a simple PDF viewer using PDFjs library (pdfjs-4.0.379-dist), where I have viewer.html and js in static resources, and pdf.mjs and pdf.worker.mjs library from CDN in viewer. Using CDN ...
2
votes
1
answer
338
views
getContentAsPDF() - Internal server error
I am trying to generate a table of records in pdf and sending it as email attachment from apex by using getContentAsPDF() method .
The method works fine until we are processing more then 12 records. ...
0
votes
1
answer
347
views
Community Users not able to generate PDF - getContentAsPdf() not working
I have looked at numerous articles but did not find a solution for Community Users and PDF creation. The idea is to auto-create a PDF when a Community user clicks on a checkbox. This is working for ...
0
votes
1
answer
355
views
getContentAsPDF() from batch Apex request works in scratch org but not production
I have a Batch class that calls a Visualforce page using getContentAsPDF() to generate a single PDF. This works flawlessly in a scratch org and in the developer logs I can see a separate call made to ...
0
votes
0
answers
63
views
currentpage.getContentAsPDF() renders hidden tables
I have created a visualforce page (pop up window) showing a confirmation letter containing student information and booking details. The page has a table in the header (or simply at the top) that ...
0
votes
1
answer
694
views
Blank PDF Generated on Use of getContentAsPDF on A VF Page When Called From an LWC Component on a Community Site
As the title says I'm calling getContentAsPDF for a VF page from an LWC component which is used on a community site. It works for Authenticated users but for Guest Users returns a blank PDF. I've done ...
-1
votes
2
answers
3k
views
I want to pass collection variable to apex class
I want to pass the collection variable from flow to Apex which generates the PDF so, in collection variable, there are multiple records ,that I want to show in visual force page
@InvocableMethod()...
0
votes
0
answers
583
views
Issue with PDF file using getContentAsPDF
I am creating attachment with paypal invoice using getContent method in apex and attaching file under record but there issue with pdf file. it's not creating properly
Here is my code :
String ...
0
votes
0
answers
162
views
Web to lead form as an attachment (PDF) to capture the data!
I am trying to capture the data with the help of a PDF file instead of a simple form (web-to-lead). is it possible?
As to provide a pdf file to the user to fill instead of a plain form and then ...
3
votes
1
answer
435
views
Get content of local Visualforce Page from managed package code
I have Manage Package, where is some logic which sends Emails with EmailFileAttachment ( using Visualforce page rendered as PDF ) to Customers.
I want to add possibility to users to use theirs Custom ...
1
vote
1
answer
939
views
Border CSS not working properly with VF page rendered as pdf
Hi I'm trying to display rounded borders in a VF page using the below style on a individual div and a tr inside a table separately.
style="text-align: left;border: 1px solid black !important;...
5
votes
0
answers
552
views
Blank PDF using getContentAsPDF in future method
I am having an issue in production with a specific Profile (a clone of the System Administrator) that generates Invoices via a @future call resulting in a blank PDF creation. Below is a simplified ...
1
vote
0
answers
213
views
Change the locale of Quote PDF
We have a problem in my org related to the locale and the creation of the Quote PDF.
We have 2 offices ("Europe" and "America") for the Quote object, specified in the Office (...
0
votes
0
answers
2k
views
get pdf from external url
In the response from 3rd party I am getting url, I want to grab that url and save that pdf in a salesforce object.
If I manually use that url and paste in browser it downloads the file. But when I use ...
0
votes
1
answer
585
views
Dynamic page numbering when generated pdf through vf page using Render as PDF
We are generating PDF using render as PDF in VF page, now we have requirement for dynamic page number on generated PDF. for example page number should start from 30 and end at 35 i.e 6 pages. If ...
1
vote
1
answer
123
views
How can we access visualforce page for pdf generation from a future annotated method
I have a future annotated method which should generate a pdf in PdfController, the method is as below:
@future(callout=true)
public static void savePdfAsAttachment(Id applicationId){
PageReference ...
1
vote
1
answer
2k
views
Create Pdf from visualforce page with button
I create a PDF with button at the account record. That works good, but now I want to pass information from the account record into my visual force. I tried it, see below, but the (AName) account name ...
2
votes
1
answer
6k
views
Trying to show PDF in Lightning web component in iFrame but it does not render the PDF file
I am trying to display a pdf file using Base64data in the Lightning Web component, the PDF Viewer renders but it does not get the PDF file in it.
here's my HTML:
<template if:true={showModal}>
...
1
vote
0
answers
1k
views
Tables in visualforce page renderAs Pdf are moving to the top of the page
I am rendering a html code as pdf in visualforce page. But the tables in the page are going to the TOP. If I remove renderAs="pdf" and check the VF page, everything looks fine. Please advice....
2
votes
0
answers
225
views
How to take input in a VF page that also needs to be rendered as a PDF with the help of getContentAsPDF()?
I have a table on a VF page that displays 3 columns.
Last column of the table is defined as follows:
<apex:column headerValue="New Value">
<apex:inputText value="{!...
1
vote
0
answers
1k
views
How to adjust column widths in Visualforce to PDF email attachment?
I wish to send a visualforce page as an email PDF attachment to user. The problem I am facing is that the columns don't fit in the PDF. Hence I sent the PDF in landscape mode. After that, some extra ...
0
votes
1
answer
2k
views
How can a VF page be attached to an email as a pdf attachment in landscape format?
I have a requirement where I have to send a VF page as a pdf email attachment to user. The problem is that a table present on the VF page has many columns and they don't fit in the pdf attachment.
All ...
0
votes
1
answer
3k
views
How to create a table in VF page that will appear as standard table and can also be emailed as a pdf attachment?
I wish to create a VF page that displays a table of data to users. If the user clicks on the 'Email' button on the VF page, the table of data should get emailed to the user in PDF format.
I ...
5
votes
2
answers
2k
views
Marketing Cloud Email Archival as PDF to FTP
I came across a requirement where I need to archive the email sent to customer as PDF onto a different Archival platform.
I currently have the preview links synced to Salesforce, which expires after ...
0
votes
1
answer
1k
views
Generate Quote PDF via Apex returns blank
I am trying to automate the generation of quote pdfs. I have found a really nice blog entry on that topic here: https://automationchampion.com/2020/06/23/getting-started-with-process-builder-part-97-...
0
votes
2
answers
87
views
Salesforce Visualforce Update Timing issue?
I have a Visualforce page (Call VF1) which does some processing and updates a Custom object (Sales_Prints__c). After updating the sales_prints__c on VF1 I need to call another visualforce page (Call ...
0
votes
0
answers
224
views
insert attachment getcontentaspdf not loading data dynamically
I have a method that call a vf page and render as pdf the following
Pagereference test = new Pagereference ('/apex/claire');
return test;
that gives me the page I am expecting
after that the ...
0
votes
1
answer
502
views
Salesforce VF - getContent() and getContentAsPdf() timeout
How to set extent default timeout for getContent and getContentAsPdf? Those are considered as callouts so I assume it should be possible to set timeout.
We are using them to generate PDF files from ...
0
votes
1
answer
83
views
Unknown Visualforce Error CompositeFont
I am getting an exception like below-
System.VisualforceException: class sun.font.CompositeFont cannot be cast to class sun.font.PhysicalFont (sun.font.CompositeFont and sun.font.PhysicalFont are in ...
3
votes
1
answer
5k
views
Page getContent / getContentAsPDF not retrieving the updated data
I'm able to get all the data by calling the Page.getContentAsPDF() function by selecting all the record from Account object.
Basically, I'm loading the pdf content based on query from page ...
1
vote
0
answers
1k
views
PageReference for quote/quoteTemplateDataViewer as PDF is blank
I'm having trouble getting a PDF when using a PageReference to the quoteTemplateDataViewer.
This class is creating a QuoteDocument on the Quote record, but the contents of the document are blank.
...
4
votes
1
answer
576
views
Generating a PDF from a Lightning Page with LockerService restrictions
I'm trying to generate a PDF from a Lightning Page using jsPDF.
When I use the addHTML function in jsPDF I get an error (but only if locker service is enabled). The problem is in the use of ...
1
vote
0
answers
379
views
Style codes appear on using getContentasPDF
I am trying to insert a pdf on click of a button using the getContentasPDF method. The page which has to be rendered is the page I'm redirecting to. I'm pasting the partial code -
PageReference ...
10
votes
2
answers
6k
views
Programmatically generate Quote PDF in Lightning Component Apex controller
I'm trying to programmatically generate and insert a Quote PDF, given a Quote Id and a Template Id, within an @AuraEnabled method in my Lightning component's server-side controller. (N.b. - the ...
0
votes
1
answer
460
views
Cache value not being saved in Org from Async call
I have a batch call that calls a queuaeble that calls a future call which utilizes a visualforce page 'getContentAsPdf' function. Also in this queuable call I set a custom class value to a local ...
1
vote
0
answers
662
views
PDF generation failed. Check the page markup is valid.- Occurred when using getContentasPDF
I have a VF page, where I am not using renderas "PDF". In the single email messaging method of Controller, I am using the Attachment as pdf of the VF page.
I used getContent() function which ...
4
votes
1
answer
27k
views
Regex including curly brackets
I have an e-mail processing class which takes the HTML content of e-mails, and stores them in rich text fields to be later rendered as PDF's to be printed via VisualForce.
However, the e-mails ...
0
votes
0
answers
900
views
Not able to save quote document as pdf display from the visualforce page
I have one visualforce page called : QuoteDetail.
This page have button called : Generate PDF.
This Generate pdf open up a popup with selection (checkboxes) 1. Remove items with no quantity 2. Show ...
3
votes
0
answers
282
views
PDF isn't rendered using apex class on community site
I have a community site with some partner users on it, and there's a specific record that I want to make available to render as PDF and be saved as attachment on the same record.
Rendering the PDF ...
4
votes
2
answers
7k
views
PageReference.GetContentAsPDF throws Internal Salesforce.com Error
The PageReference.GetContentAsPDF method throws an internal Salesforce.com Error when there is a problem generating the page. i.e. when an exception is thrown in the controller.
This makes it very ...
0
votes
1
answer
190
views
apex:repeat render as pdf cant format based on css tags for table or td or th or span
.bPageBlock .pbBody table {
min-width: 90% !important;
max-width: 90% !important;
width: 90% !important;
margin: 0 auto !important;
}
.bPageBlock .pbBody td {
width: 45% !...
1
vote
1
answer
194
views
getContentAsPDF() SOQL has no rows
I have a problem. I need to get pdf and attach it to object.
I create object (and for test I execute query - it's ok), get ID and put it to page as parametr:
PageReference pdfPage = Page....
1
vote
1
answer
422
views
How to render page as PDF in a seperate subtab
I'm looking for a way to open a new subtab in the service console that renders an existing form as a PDF prior to saving the form and without storing the PDF in Salesforce.
I managed to work out how ...
3
votes
2
answers
1k
views
Why am I not able to get full 60 second CPU time in @future method with getContentAsPDF()
I'm trying to generate a PDF, and in normal Apex execution the function is haulted due to CPU timeout (exceeding 10 second execution time).
So I tried using @future annotation to use Asynchronous ...
1
vote
1
answer
483
views
How to change the design of the exported Excel or PDF files?
I'm providing an export links to export some result into a PDF or Excel files.
The tables, in the exported files, don't look that good and I had tried to add some style to my VF page but it didn't ...
2
votes
2
answers
573
views
displaying the vf page details as pdf
I am trying to coverting vf page as pdf format,for that am usinf contentType="application/pdf"
<apex:page standardController="Opportunity" extensions="PDFcontroller"
...
0
votes
1
answer
2k
views
Increase PDF height to show in one page
I have an HTML used Apex page which has renderas PDF tag for PDF conversion. But the content is too long and coming in two pages. I need to keep it in one Page. Can someone suggest a solution?
Apex ...