在 jsPDF 的 documentation 中我找不到增加文本行之间空间的方法或函数。我想知道是否有知识渊博的人会点头分享他/她的一些知识:)。非常感谢。
最佳答案
你也可以在jsPDF构造函数中添加参数:
file = new jsPDF({orientation: "p", lineHeight: 1.5)})
来自 jsPDF 代码(函数 jsPDF(orientation, unit, format, compressPdf)):
var options = {};
if (typeof orientation === 'object') {
options = orientation;
orientation = options.orientation;
unit = options.unit || unit;
format = options.format || format;
compressPdf = options.compress || options.compressPdf || compressPdf;
}
// Default options
unit = unit || 'mm';
format = format || 'a4';
orientation = ('' + (orientation || 'P')).toLowerCase();
var format_as_string = ('' + format).toLowerCase(),
compress = !!compressPdf && typeof Uint8Array === 'function',
textColor = options.textColor || '0 g',
drawColor = options.drawColor || '0 G',
activeFontSize = options.fontSize || 16,
lineHeightProportion = options.lineHeight || 1.15,
lineWidth = options.lineWidth || 0.200025; // 2mm
关于javascript - jsPDF调整文本行间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18522323/