3

I am trying to build a resume builder using React. I want the user to get the PDF version of their resume by clicking the download button but I don't know how to achieve that.

I had tried jsPDF and it is converting the editor div to PDF but not preserving CSS.

I had also tried jsPDF with html2canvas and it is converting the div to PDF with preserved CSS, but that PDF is made of images which means the text is not selectable and links are not clickable.

I am able to get PDF with selectable texts and preserved CSS when opening print dialogue box and saving as PDF, but I want a one-click solution. I don't want my user to perform extra efforts.

How can I save my div and its styles as a functional PDF? Alternatively, how can I use the browser's save as PDF function in a single click?

D M
  • 5,769
  • 4
  • 12
  • 27
fiza
  • 43
  • 1
  • 4
  • [Check this out](https://stackoverflow.com/questions/20364212/limit-print-area-to-a-div) –  Dec 13 '21 at 18:59
  • I know how to focus on particular div for printing and i am also able to achieve when opening print dialogue box and saving it as pdf from there. But I want a button clickable solution – fiza Dec 13 '21 at 19:02
  • These links might be helpful: https://www.adobe.com/bg/acrobat/how-to/convert-html-to-pdf.html https://wkhtmltopdf.org/ https://www.evopdf.com/?gclid=EAIaIQobChMIq4Pww77h9AIVuRkGAB3GTg5jEAAYASAAEgKBSvD_BwE – Azu Dec 13 '21 at 19:15
  • Its of no use as i want my user to get these service . – fiza Dec 14 '21 at 11:14

0 Answers0