jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

Form TextField doesn't support Customized Fonts?

Open xiaohuilam opened this issue 4 years ago • 5 comments

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

xiaohuilam avatar Jun 16 '21 07:06 xiaohuilam

Thanks for the report. Help is welcome :)

HackbrettXXX avatar Jun 16 '21 08:06 HackbrettXXX

I also met this issue today.....

jy03187487 avatar Oct 21 '21 08:10 jy03187487

Well. AcroForm is currently not able to use custom fonts. I think this could be a little bit tricky to implement as you have to fix also the corresponding annotations.

Uzlopak avatar Oct 21 '21 12:10 Uzlopak

😊 "I'd be delighted to work on this issue, @xiaohuilam Could you please assign it to me?"

TechWizard9999 avatar Sep 30 '23 21:09 TechWizard9999

😊 “我很高兴能解决这个问题,你能把它分配给我吗?”

sorry, i'm not administrator of this repo, i have no permission to assign issues. perhaps @HackbrettXXX could.

xiaohuilam avatar Oct 01 '23 12:10 xiaohuilam