All Questions
Tagged with pdf lightning-web-components
38 questions
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 ...
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 ...
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. ...
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,...
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 ...
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 ...
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 ...
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,...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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="...
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 ...
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 ...
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 ...
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: ...
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 ...
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 ...
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 ...
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/...
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
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="...
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 ...
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-...
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....
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(...
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]....
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 ...
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....
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.
...
-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-...