[SalesForce] Print lightning component to PDF

I've got a lightning component who looks like a web page. The user wants a button to print that as PDF.

I didn't find solution, though I did try some things:

  • Build a visualforce page with my embedded lightning component. But I can't render the VFP as PDF with the lightning component because the component is added to page using Javascript and render is before in server.

  • I tried with jsPDF.js library without success.

Best Answer

Simply use Window.Print() function and add that function to a button click event.

Related Topic