function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
igorcguedesigorcguedes 

Display VisualForce PDF at LWC

Hello, I have a form in LWC that at the end I need it to show a VisualForcePage rendered as PDF, how do I call it? I already have it done as VFP.

Like, when the user Clicks to finish the form, call the VisualForce page and display like that:

User-added image

AnkaiahAnkaiah (Salesforce Developers) 
Hi,

The PDF renderer does not support JavaScript, but Aura and LWC components are always loaded via JavaScript. That means it is impossible to use renderAs to render an Aura Component or LWC component in to a PDF. There is no workaround to this limitation. You'll need to write the full code in Visualforce if you want to be able to render the page as a PDF.

Refer the below link
https://salesforce.stackexchange.com/questions/280185/issue-in-pdf-generation-of-a-lwc-component-in-visualforce


You can do it directly in LWC and refer the below and modfiy your code accordingly.
https://salesforce.stackexchange.com/questions/342372/how-to-generate-a-pdf-and-have-it-download-from-a-lightning-web-component

If this information helps, Please mark it as best answer.

Thanks!!