gpt4 book ai didi

javascript - 在哪里更改 jspdf.debug.js 中的默认 pdf 页面宽度和字体大小?

转载 作者:IT王子 更新时间:2023-10-29 03:19:48 46 4
gpt4 key购买 nike

我需要在 jspdf.debug.js 中更改默认的 pdf 页面宽度和字体大小

在何处以及如何更改 jspdf.debug.js 中的默认值?

最佳答案

除了使用一种默认格式外,您还可以在您指定的单位中指定您想要的任何大小。

例如:

// Document of 210mm wide and 297mm high
new jsPDF('p', 'mm', [297, 210]);
// Document of 297mm wide and 210mm high
new jsPDF('l', 'mm', [297, 210]);
// Document of 5 inch width and 3 inch high
new jsPDF('l', 'in', [3, 5]);

构造函数的第三个参数可以采用维度数组。但是它们不对应宽度和高度,而是长边和短边(或翻转)。

您的第一个参数(landscapeportrait)决定了宽度和高度。

在 GitHub 上的源代码中,您可以看到 supported units (relative proportions to pt) , 你还可以看到默认的 page formats (with their sizes in pt) .

关于javascript - 在哪里更改 jspdf.debug.js 中的默认 pdf 页面宽度和字体大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23104008/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com