parallax/jsPDF

Form TextField doesn't support Customized Fonts?

オープン

#3,185 opened on 2021/06/16

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (4,596 件のフォーク)batch import
BugImprovementdifficulty:mediumhacktoberfesthelp wanted

Repository metrics

Stars
 (28,280 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド