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?