What is the size in pixels for jspdf's 'a4' format? I want to add an image to pdf so it will take full width of the document.
new jsPDF('p', 'pt', 'a4');
You can get the width and height of PDF document like below, var doc = new jsPDF("p", "mm", "a4"); var width = doc. internal. pageSize.
jsPDF(orientation, unit, format) Creates new jsPDF document object. instance Parameters: orientation One of "portrait" or "landscape" (or shortcuts "p" (Default), "l") unit Measurement unit to be used when coordinates are specified.
new jsPDF('p', 'pt', [ 595.28, 841.89])
In the sourcecode on GitHub you can see the supported units (relative proportions to pt), and you can also see the default page formats (with their sizes in pt).
Hope this could help,
Laura.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With