[GH-ISSUE #1333] Support for Unicode characters in pdf fillable fields #373

Open
opened 2026-02-26 18:46:45 +03:00 by kerem · 1 comment
Owner

Originally created by @ExcelsiorEyer on GitHub (Sep 8, 2024).
Original GitHub issue: https://github.com/documenso/documenso/issues/1333

Issue Description

Special unicode characters like currency symbols in fillable form fieldsis causing an error in the Api

Steps to Reproduce

Include special unicode characters in formValues of the generate-document api. If the unicode characters are removed, it works just fine.

Expected Behavior

When typed manually the pdf accepts those characters and the template should accept that while generating the document

Current Behavior

{ _err: Error: WinAnsi cannot encode "₹" (0x20b9) at Encoding.encodeUnicodeCodePoint (/app/node_modules/@pdf-lib/standard-fonts/lib/Encoding.js:23:23) at StandardFontEmbedder.encodeTextAsGlyphs (/app/node_modules/pdf-lib/cjs/core/embedders/StandardFontEmbedder.js:88:41) at StandardFontEmbedder.encodeText (/app/node_modules/pdf-lib/cjs/core/embedders/StandardFontEmbedder.js:28:27) at PDFFont.encodeText (/app/node_modules/pdf-lib/cjs/api/PDFFont.js:37:30) at exports.layoutSinglelineText (/app/node_modules/pdf-lib/cjs/api/text/layout.js:197:24) at exports.defaultTextFieldAppearanceProvider (/app/node_modules/pdf-lib/cjs/api/form/appearances.js:260:31) at PDFTextField.updateWidgetAppearance (/app/node_modules/pdf-lib/cjs/api/form/PDFTextField.js:719:61) at PDFTextField.updateAppearances (/app/node_modules/pdf-lib/cjs/api/form/PDFTextField.js:713:18) at PDFTextField.defaultUpdateAppearances (/app/node_modules/pdf-lib/cjs/api/form/PDFTextField.js:689:14) at PDFForm.updateFieldAppearances (/app/node_modules/pdf-lib/cjs/api/form/PDFForm.js:542:23) }

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

No response

Browser [e.g., Chrome, Firefox]

No response

Version [e.g., 2.0.1]

No response

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @ExcelsiorEyer on GitHub (Sep 8, 2024). Original GitHub issue: https://github.com/documenso/documenso/issues/1333 ### Issue Description Special unicode characters like currency symbols in fillable form fieldsis causing an error in the Api ### Steps to Reproduce Include special unicode characters in formValues of the generate-document api. If the unicode characters are removed, it works just fine. ### Expected Behavior When typed manually the pdf accepts those characters and the template should accept that while generating the document ### Current Behavior `{ _err: Error: WinAnsi cannot encode "₹" (0x20b9) at Encoding.encodeUnicodeCodePoint (/app/node_modules/@pdf-lib/standard-fonts/lib/Encoding.js:23:23) at StandardFontEmbedder.encodeTextAsGlyphs (/app/node_modules/pdf-lib/cjs/core/embedders/StandardFontEmbedder.js:88:41) at StandardFontEmbedder.encodeText (/app/node_modules/pdf-lib/cjs/core/embedders/StandardFontEmbedder.js:28:27) at PDFFont.encodeText (/app/node_modules/pdf-lib/cjs/api/PDFFont.js:37:30) at exports.layoutSinglelineText (/app/node_modules/pdf-lib/cjs/api/text/layout.js:197:24) at exports.defaultTextFieldAppearanceProvider (/app/node_modules/pdf-lib/cjs/api/form/appearances.js:260:31) at PDFTextField.updateWidgetAppearance (/app/node_modules/pdf-lib/cjs/api/form/PDFTextField.js:719:61) at PDFTextField.updateAppearances (/app/node_modules/pdf-lib/cjs/api/form/PDFTextField.js:713:18) at PDFTextField.defaultUpdateAppearances (/app/node_modules/pdf-lib/cjs/api/form/PDFTextField.js:689:14) at PDFForm.updateFieldAppearances (/app/node_modules/pdf-lib/cjs/api/form/PDFForm.js:542:23) }` ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] _No response_ ### Browser [e.g., Chrome, Firefox] _No response_ ### Version [e.g., 2.0.1] _No response_ ### Please check the boxes that apply to this issue report. - [X] I have searched the existing issues to make sure this is not a duplicate. - [X] I have provided steps to reproduce the issue. - [X] I have included relevant environment information. - [ ] I have included any relevant screenshots. - [X] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [ ] I want to work on creating a PR for this issue if approved
Author
Owner

@github-actions[bot] commented on GitHub (Sep 8, 2024):

Thank you for opening your first issue and for being a part of the open signing revolution!

One of our team members will review it and get back to you as soon as it possible 💚

Meanwhile, please feel free to hop into our community in Discord

<!-- gh-comment-id:2336546268 --> @github-actions[bot] commented on GitHub (Sep 8, 2024): Thank you for opening your first issue and for being a part of the open signing revolution! <br /> One of our team members will review it and get back to you as soon as it possible 💚 <br /> Meanwhile, please feel free to hop into our community in [Discord](https://documen.so/discord)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#373
No description provided.