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
karthik 369karthik 369 

How to download PDF using Lightning component when Button is clicked in the Lightning page

Hi All
I need to download a PDF page using the Lightning component for the object detail page in Lightning view.
Please share the code if any one has.

Thank in advance.
Alen PS (Heptarc)Alen PS (Heptarc)

Dear Karthik,

We cannot directly generate PDF as we do in Visual force page using 'renderAs' But instead you can embed the visual force page in lightning component which inturns does the funtionality required.Please refer the below link.

https://salesforce.stackexchange.com/questions/205065/how-to-generate-view-pdf-using-lightning-components/205227

http://www.vermanshul.com/2017/07/lightning-generate-pdf-from-lightning.html

Hope this well be useful.

Regards,
Alen