PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
You can edit the font family on the panel of the content editor. The following code shows you how to set the font family:
const customFonts = instance.UI.Fonts.getAnnotationFonts();
// Add a custom font
instance.UI.Fonts.addAnnotationFont({
fontFamily: "CustomFont",
fontName: "CustomFont"
});
// Remove the font
instance.UI.Fonts.removeAnnotationFont(customFonts[0]);
// You can also set the order of the fons
const fonts = instance.UI.Fonts.getAnnotationFonts();
const font = fonts[0];
fonts[0] = fonts[1];
fonts[1] = font;
instance.UI.Fonts.setAnnotationFonts(fonts);You can also set the font size on the panel of the content editor. The following code shows you how to set the font size:
// Get font sizes
instance.UI.Fonts.getFontSizes();
// Set font sizes
instance.UI.Fonts.setFontSizes([12, 14, 16, 18, 20]);