Skip to main content

All Questions

Filter by
Sorted by
Tagged with
4 votes
1 answer
73 views

Replicate the VF renderAs="PDF" Functionality Using LWC

We currently have a VF page (rendered as PDF) that generates invoice data. We use it in several places in the org: it's accessible via a record action on the Invoice record page, it can be sent as an ...
Asdrubal Grande's user avatar
2 votes
2 answers
574 views

Issues using jsPDF library in an LWC

recently in our org we have needed the ability to create PDF files. I am aware you can do this using visualforce pages with the render as PDF method, however we would like the pdf to be styled more ...
Jake Colledge's user avatar
1 vote
0 answers
451 views

Create PDF (or other exportable file) out of a LWC

How can one export a LWC as a PDF? (Same as this post, with a slightly different angle) A couple hours of research have not yielded any useful results Requirement: Create a way to export the LWC so it ...
Miguel Diaz's user avatar
0 votes
0 answers
230 views

display pdf in Iframe in lwc

Getting below error while displaying a pdf in iframe in lwc top.location='https://utalmesivtakj--developer2.sandbox.my.salesforce.com/ex/errorduringprocessing.jsp' My HTML : <iframe id="...
Sahil Gupta's user avatar
0 votes
1 answer
119 views

getContent() works in JS Button but not in Quick Action LWC

I am working on converting some JS buttons to Lightning. These buttons invoke an Apex class that calls getContent() on a VisualForce page with a renderas attribute of PDF & then store that output ...
Jack Odell's user avatar
1 vote
1 answer
1k views

Trouble loading PDF.js lib in LWC

I have trouble loading the PDF.js library in my Lightning Web Component. Whenever I load the page with the component, I get : PDF.js could not be loaded undefined Twice, this additional error popped ...
Domovyak's user avatar
1 vote
2 answers
721 views

jsPDF is not working in LWC

Trying to generate PDF with JSPDF library but getting below error message when I'm trying to preview the PDF through Community or record pages in salesforce. Error TypeError: Cannot destructure ...
mandeep singh's user avatar
0 votes
0 answers
379 views

Getting Error 'An internal server error has occurred' while passing invoice template html data from LWC to Visualforce Page to render as PDF

Html Code : <div class="invoice_container" style="width: 100%; max-width: 900px; margin: 0 auto; padding: 20px; font-family: Arial, sans-serif; color: #333; background-...
Pratik Bokade's user avatar
0 votes
1 answer
1k views

Not able to render HTML in PDF using jsPDF library in LwC

I am trying to build a simple custom pdf in LwC using jsPDF v2.5.1 library and loading this library using loadscript in rendered callback method, now I am trying render HTML content in PDF using doc....
Sagar 's user avatar
  • 25
2 votes
0 answers
2k views

LWC save or print as pdf

I have built out an LWC to that I'm displaying externally in a community (public). I trying to put a print/save button on the LWC to print/save the LWC as a PDF. I've looked into jspdf and some others,...
mackmama's user avatar
  • 741
3 votes
1 answer
3k views

Is it possible to call a LWC from Apex?

I need to create a PDF document completely customizable and I decided to use an external JS PDF generation lib (PDF-lib) to create the documents from a LWC instead of using the Visualforce PDF method. ...
Luis Fernando Kumruyan's user avatar
0 votes
1 answer
186 views

SFDC Probelm while viewing preview in LWC

While previewing the document , it is showing no preview, please give input if possible , and i have pasted the code below handleDocumentView(event){ console.log('view button called'); console.log(...
sharanabasava jnv's user avatar
0 votes
2 answers
1k views

problem with adding custome font and pdf-lib

I am trying to use pdf-lib to create and edit pdf files. Imported libraries as static resources, source code from here https://unpkg.com/pdf-lib/dist/pdf-lib.js https://unpkg.com/@pdf-lib/[email protected]....
Kam Kaliev's user avatar
-1 votes
1 answer
1k views

How we can export data in PDF format in lightning web Component?

html:- <template> <lightning-card title="Account to Contact Communication in LWC" icon- name="standard:contact"> <div class="slds-var-m-...
Crazy XYZ's user avatar
1 vote
1 answer
2k views

How to pass data from javascript controller to iframe in LWC

I am trying to pass a pdf as a preview to an Iframe in LWC. Note: a preview, not showing an existing pdf I followed following example: How to render a PDF generated with jsPDF in a LWC How do I pass ...
Thomas's user avatar
  • 2,320
1 vote
1 answer
2k views

How to create pdf using pdfjs library in lwc

I have a lwc in which I try to render a pdf. I have zipped the pdfjs library and added this as a static resource. In my template I can call the library as following: <iframe id="...
Thomas's user avatar
  • 2,320
1 vote
0 answers
1k views

Generate PDF With LWC

Need to save a pdf of the particular div which include Lightning-Datatable. Below are options I don't want to use as workaround: window.print(); Vf redirect(Solutions without Visualforce Page) Tried ...
Shreyash Vyas's user avatar
1 vote
2 answers
7k views

Generate and download PDF file from Base64 Encode String

I want to create a LWC to download a simple PDF file with a random string. Here is my code: Apex Class: public with sharing class PdfLwcController { @AuraEnabled public static String ...
Tran Tai's user avatar
1 vote
0 answers
2k views

LWC: Render PDF files as images using pdfjs

TLDR: Any working implementation of pdf.js or other 3rd party js to render pdf as images in LWC would be helpful. I want to render pdf pages as images in order to plot dynamic SVGs. Similar to image ...
Pranav Parakh's user avatar
2 votes
2 answers
2k views

LWC: Load static resource PDF to use with third party library: PDF-Lib

Long-time answerer, first-time questioner... I am trying to fill out a pdf in LWC using a third-party library, PDF-Lib. There is a great example of how to create a pdf with this library that gets me ...
David at Experance Partners's user avatar
1 vote
0 answers
234 views

How to add complete child LWC component HTML content in PDF file?

I have two child LWC components and I have merged in parent component. Now I want to create PDF file which will be having data of HTML content of both the child HTML component. Using below code I am ...
Vani Mude's user avatar
0 votes
1 answer
1k views

PDF.js does not render the provided PDF in LWC

I am trying to use pdf.js to render a base64 representation of a pdf. My component is as follows : <template> <div class="wrapper"> <iframe src="/resource/...
N_H1922's user avatar
  • 357
3 votes
1 answer
6k views

Generating pdf - LWC - using jsPDF

I am trying to generate pdf using JSPdf in LWC using the below code. The lwc is embedded on Account record page. However I am getting the error. It is happening just before the line in JS doc.table(30,...
Priyanka's user avatar
  • 1,919
1 vote
2 answers
955 views

Issue with PDF.JS in the latest version of aura components

I'm making use of pdf.js library to parse a pdf into images. I'm importing the library by making use of static resources and this library/below logic is working fine if the custom component API ...
Mister Perfect's user avatar
1 vote
1 answer
11k views

How to render a PDF generated with jsPDF in a LWC

I'm new to Salesforce development and currently try to render a PDF that has been generated with jsPDF in a modal (i.e., I managed to generate PDFs from an LWC using jsPDF, yet I'd like to render it ...
Benjamin Behringer's user avatar
6 votes
2 answers
33k views

How to generate a PDF and have it download from a Lightning Web Component

I'm trying to show a button on a Lightning Web Component, that when clicked generates a PDF and immediately starts downloading it on the browser. The LWC lives in a Screen Flow and I'm currently ...
Dan's user avatar
  • 215
0 votes
2 answers
205 views

Lightning LWC - Copy List with Limited fields [closed]

I am using the wire service to query several fields and assign to a list. I am trying to create a PDF using jsPDF and I need to create another list that only contains the fields that I will display ...
Frank's user avatar
  • 459
1 vote
1 answer
2k views

Save Visualforce Page as PDF from LWC component

I have a visualforce page that I can open from a lightning web component with using the following: openPdf1() { this[NavigationMixin.GenerateUrl]({ type: 'standard__webPage', attributes: ...
Frank's user avatar
  • 459
0 votes
1 answer
1k views

Get HTML from rendered LWC to use in Blob.toPdf()

It seems LWC doesn't have a standard way to convert an app/page to PDF. I've tried using VFP w/LWC in it via lightning out, as per here: Using LWC in VFP But that doesn't make the LWC content ...
torpy's user avatar
  • 355
0 votes
1 answer
768 views

Create salesforce record from PDF

I am trying to build a utility where a user can upload a pdf or word and after successful upload, it should create a record in salesforce by reading that pdf/word? Is it something doable? If not, can ...
Manish Anand's user avatar
1 vote
1 answer
1k views

Perform Callout, get byte[] and view pdf

I have a requirement to perform a callout, get response (byte array) that is a PDF base 64 encoded. Then, i need to show the pdf, without saving any data in Salesforce. I just need to view the ...
Giorgos Galaios's user avatar
1 vote
1 answer
6k views

Convert base64 to pdf and display it in LWC

I have an apex that returns a string, and I want this string to decode it and display it as a pdf to a modal in Lightning Web Component. How can I achieve this? How can I display the pdf without ...
Kostas Karagiannis's user avatar
0 votes
1 answer
267 views

can we set render as value of vf page from LWC using lms after the component is rendered? [closed]

can we set render as value of vf page from LWC using lms after the component is rendered ? SO that after my LWC component renders , it'll be shown as PDF from Visualforce
Salesforcegeek's user avatar
0 votes
0 answers
57 views

Best Approach to Render a PDF from External Source Without Storing File and Preventing User Download On Mobile [duplicate]

I am working on a requirement to display a PDF that is returned from an external application. I've written the Apex class that will authenticate and then return the PDF document in a HTTP Get response....
Coogle's user avatar
  • 445
1 vote
1 answer
3k views

How To Merge Concatenate Two PDF Files In Salesforce [closed]

I was wondering if there's a possibility to meet this requirement using any PDF tool (maybe Conga) in a Salesforce Org. I'm making a LWC that must merge or conc a group of PDF files related with a ...
Emmanuel_M's user avatar
0 votes
0 answers
44 views

How to convert LWC pages into PDF format? [duplicate]

My current requirement is to convert LWC page into PDF format. I tried built in 're-render as PDF' option though VF page. But it does not look good & i am not able to add Graphs/Charts into it. ...
user avatar
2 votes
1 answer
4k views

Issue in PDF generation of a LWC component in Visualforce

Does anybody done pdf generation by means of LWC(with Visualforce page). I have done following code and it is working fine, until renderAs comes. If anybody knows a solution/workaround, please let me ...
Ysr Shk's user avatar
  • 3,175
2 votes
1 answer
2k views

jsPDF and Salesforce Lightning Web Component

I'm trying to create a Salesforce Lightning Web Component to create a custom Quote PDF using jsPDF. I mastered to use the external chart.js library with uploading it as a static resource, but when I ...
Michael's user avatar
  • 21