Skip to content

Setting font-family for AcroFrom not working properly #1096

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
r4tz52 opened this issue Mar 6, 2020 · 2 comments
Open

Setting font-family for AcroFrom not working properly #1096

r4tz52 opened this issue Mar 6, 2020 · 2 comments
Labels

Comments

@r4tz52
Copy link

r4tz52 commented Mar 6, 2020

Bug Report

Description of the problem

Setting custom font for text AcroForm has no effect if PDF file opened in Adobe Acrobat Reader, but works fine in Google Chrome:
aladin

PDF file example: aladin.pdf

Code sample

doc.font('aladin.regular.ttf');
doc.formText('InputField1', 10, 10, 200, 20, { value: 'Aladin' });

Your environment

  • pdfkit version: 0.11.0
  • Browser version: Google Chrome 80.0.3987.122
  • Operating System: Windows 10
@KaiPressmar
Copy link

Same issue for custom fonts

Example code:

const PDFDocument = require("pdfkit");
const fs = require("fs");

var doc = new PDFDocument();
doc.pipe(fs.createWriteStream("out.pdf"));

doc.font("./SourceCodePro-Regular.ttf");
doc.initForm();

// Dynamic fields do not work
doc.formText("txt1", 20, 20, 100, 10, {
  value: "Test 01234",
});

// Normal text elements work
doc.text("Test 01234", 20, 40, 100, 10);

doc.end();

Output:

image

Environment

pdfkit version: 0.11.0
Browser version: 80.0.3987.163 (Offizieller Build) (64-Bit)
Operating System: Windows 10

@bowespublishing
Copy link

Is there an update on this at all please?

@liborm85 liborm85 added the bug label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants