How to download the current webpage in PDF format in LWC?
Download the webpage in PDF in LWC - there might be a business requirement like this and let me walk you through how to implement it.
One of the major challenges with Lightning Experience is working with PDFs.
Here's where some of the popular packages like Conga, PDF Buttler come into the picture.
Agreed that we can get things done using a Visualforce page with a bit of a workaround.
Here am gonna walk you through a simple solution to download the current webpage in PDF Format in LWC.
The beauty of this solution is we will not be using any managed packages or external libraries.
I have a Web Component with a button here which download the page in PDF format.
This trick is going to print the complete page, however, you were to hide a few elements from printing, check this out.
This is going to open the print popup and there we can use the option 'Save As' and save the file to the machine. Simple isn't it?
Hope this helps!