jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

how to improve the quality of pdf generated using addHTML method

Open mithun27 opened this issue 10 years ago • 5 comments

Thank you for submitting an issue to jsPDF. Please read carefully.

Are you using the latest version of jsPDF?

Have you tried using jspdf.debug.js?

Steps to reproduce

Ideally a link too. Try fork this http://jsbin.com/rilace/edit?html,js,output

What I saw

What I expected

mithun27 avatar Jul 22 '16 07:07 mithun27

Hi there,

There's now a html2pdf example which much better supports generating documents from HTML.

Get the latest master and try:

npm install
npm start

Then visit localhost:8000/examples/html2pdf/showcase.html

Hope this works well for you :)

Many thanks, James

MrRio avatar Sep 28 '16 20:09 MrRio

See https://github.com/MrRio/jsPDF/issues/944

pablomaurer avatar Nov 11 '16 07:11 pablomaurer

I am not able to create high-res pdf.

var pdf = new jsPDF('l', 'pt', 'letter');

    pdf.addHTML(document.getElementById('certificateimage'), function () {
        pdf.internal.scaleFactor = 10.75;

shujaatxp avatar Feb 22 '18 11:02 shujaatxp

Changing the scaleFactor will not result in getting a high resolution PDF...

And what does it have to do with this closed issue?

Uzlopak avatar Feb 22 '18 11:02 Uzlopak

When creating canvas it has const canvas = await html2canvas(elems, { scale: "QUALITY" })

If QUALITY is hight, size of a file is High

sun1211 avatar Jun 14 '20 08:06 sun1211