parallax/jsPDF

Form TextField doesn't support Customized Fonts?

Open

#3,185 创建于 2021年6月16日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)JavaScript (28,280 star) (4,596 fork)batch import
BugImprovementdifficulty:mediumhacktoberfesthelp wanted

描述

Run this code at https://mrrio.github.io/jsPDF/

var {
 
  TextField
} = jsPDF.AcroForm;

var doc = new jsPDF();

doc.addFont("test/reference/MouhitsuBold.ttf", "Mouhitsu", "bold");

doc.setFont("Mouhitsu", "bold"); // set font
doc.setFontSize(20);
doc.text("なに", 20, 20);



doc.text("TextField:", 20, 45);
var textField = new TextField();
textField.Rect = [60, 40, 30, 10];
textField.multiline = true;
textField.value = "なに";
textField.fontName = "Mouhitsu";
textField.fontStyle = "bold";
textField.fieldName = "TestTextBox";
doc.addField(textField);

贡献者指南

Form TextField doesn't support Customized Fonts? · parallax/jsPDF#3185 | Good First Issue