哪里可以在jspdf.debug.js中更改默认的pdf页面宽度和字体大小? [英] Where to change default pdf page width and font size in jspdf.debug.js?

查看:805
本文介绍了哪里可以在jspdf.debug.js中更改默认的pdf页面宽度和字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

Where and how to change the default values in jspdf.debug.js?

推荐答案

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

Besides using one of the default formats you can specify any size you want in the unit you specify.

例如:

// 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]);

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

The 3rd parameter of the constructor can take an array of the dimensions. However they do not correspond to width and height, instead they are long side and short side (or flipped around).

您的第一个参数(landscapeportrait)确定宽度和高度.

Your 1st parameter (landscape or portrait) determines what becomes the width and the height.

在GitHub上的源代码中,您可以看到支持的单位(相对比例)到pt),您还可以看到默认的页面格式(其大小在pt中).

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).

这篇关于哪里可以在jspdf.debug.js中更改默认的pdf页面宽度和字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆