V
V
Viktor Shcherbakov2021-07-18 15:47:55
JavaScript
Viktor Shcherbakov, 2021-07-18 15:47:55

How to add Cyrillic support to PDF-LIB?

There is an excellent library for generating PDF in JS, everything would be fine, but it does not support Cyrillic, or I could not figure it out. Tell me how to add Cyrillic support.

Library example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Adamos, 2021-07-18
@Adamos

The library has documentation and it sounds like a refrain:

IMPORTANT : The default font used to update appearance streams is StandardFonts.Helvetica. Note that this is a WinAnsi font. This means that encoding errors will be thrown if this field contains any options with characters outside the WinAnsi character set (the latin alphabet).
Embedding a custom font and passing it to PDFForm.updateFieldAppearances or PDFOptionList.updateAppearances allows you to generate appearance streams with characters outside the latin alphabet (assuming the custom font supports them).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question