jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

the html method expands/zooms

Open kamranmuazzam opened this issue 6 years ago • 2 comments

I noticed that while using the pdf.html() method, the scale factor by which the html is drawn to the pdf is related with the zoom aka scaleFactor of the browser window.

Steps to reproduce: create any pdf document that uses the .html() method, then output various pdfs using different zoom values, for example, 100%, 150%, 200%. The higher the zoom value the bigger the content of html is.

I have checked it several times, and at times the contents get so much bigger that they go out of the page.

I believe that the problem is with html2canvas but should be possible to solve with some look into fixing the aspect ratio of the window.

kamranmuazzam avatar Dec 13 '19 19:12 kamranmuazzam

It's probably easier to just set the scale from html2canvas.

            html2canvas: {
            	scale: scaleValue
            },
            callback: function() { ... }

html2canvas: Canvas renderer initialized (768x611 at -100000,13.333333015441895) with scale 0.78125

kakugiki avatar Feb 06 '20 18:02 kakugiki

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

github-actions[bot] avatar Jul 05 '20 01:07 github-actions[bot]