Issue after downloading html as pdf. Can't select texts, and the hyperlinks are not clickable in the downloaded pdf

71 Views Asked by At

I need to download a pdf just as the same structure and design of the html. In the downloaded pdf, the texts must be selectable and the hyperlinks must be clickable. I tried html2canvas,jspdf, and html2pdf packages but not working. In html2pdf hyperlinks are clickable but cant select text.

I tried converting html to image first using html2canvas and then used jspdf to download it. Also I tried using html2pdf but the texts cant be selected in that case.

Is there any other package which satisfies the above mentioned needs.

1

There are 1 best solutions below

0
Mr. Terminix On

I am pretty sure that jsPDF and PDFKit are able to create pdf documents with text, which can be selected. I just used .html method of jsPDF to create pdf file from html element and I can select the text. The links can be added too.