Skip to content
Advertisement

JsPDF scale to size?

I currently have the following issue:

I have a specific DIV container that I want to generate a PDF file from. I’m using the HTML2PDF.JS scripts from ekoopmans (https://www.npmjs.com/package/html2pdf.js/v/0.9.0)

The only thing is, I want it to look like a regular print.

Print view: https://i.stack.imgur.com/s9ap7.jpg

PDF export: https://i.stack.imgur.com/hDeMW.jpg

It seems like the PDF export is zoomed in.

Is there any rule I am missing in my code? or is there a workaround? Code:

JavaScript

All the help is really appreciated!

Advertisement

Answer

Fixed the issue!

Had to change the HTML2Canvas size, then JsPDF did the rest.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement