My environment is node v12.16.1 with typescript added.
I am using pdf-lib v1.16.0 (https://www.npmjs.com/package/pdf-lib) in order to fill the form for given PDF file. Library source code can be found here https://github.com/Hopding/pdf-lib and more on docs here https://pdf-lib.js.org/.
Regarding fonts pdf-lib has a set of called StandardFonts which is provided inside the lib.
export enum StandardFonts {
Courier = 'Courier',
CourierBold = 'Courier-Bold',
CourierOblique = 'Courier-Oblique',
CourierBoldOblique = 'Courier-BoldOblique',
Helvetica = 'Helvetica',
HelveticaBold = 'Helvetica-Bold',
HelveticaOblique = 'Helvetica-Oblique',
HelveticaBoldOblique = 'Helvetica-BoldOblique',
TimesRoman = 'Times-Roman',
TimesRomanBold = 'Times-Bold',
TimesRomanItalic = 'Times-Italic',
TimesRomanBoldItalic = 'Times-BoldItalic',
Symbol = 'Symbol',
ZapfDingbats = 'ZapfDingbats',
}
Very often you would have requirement to apply font which is not on the list. One example is when you have some user documents/forms to fill and then to apply electronical signature on it in order to approve them. Sometimes that electronic signature can be of a different font type, chosen by the user.
So, how we can add new font type of our choice?


