I’ve added PDF editing functionality using WebViewer, and it’s working fine overall.
However, I’m running into an issue with fonts: when I type new text that doesn’t already exist in the document, the intended font isn’t applied correctly. Instead, a default Arimo font is used.
Even when I try to change the font to another one, it doesn’t update. It seems this issue is related to embedded fonts when editing PDFs.
Notably, this problem only occurs with new text or characters that weren’t originally in the PDF.
I’ll share a Loom video so you can see exactly what’s happening and help me resolve this embedded font issue quickly.
Please describe your issue and provide steps to reproduce it:
I’m using WebViewer for PDF editing, and while viewing and annotating existing text works correctly, there’s a problem when adding new text. The newly added text does not respect the selected font and instead defaults to the Arimo font.
Load a PDF in WebViewer that has embedded fonts.
Activate the text editing tool and add new text to any location in the document.
Observe that the new text defaults to Arimo regardless of the selected font.
Attempt to change the font using the font dropdown or programmatically via Core.setFonts(); the font does not update.
Verify that original text in the PDF retains its intended font.
Please provide a link to a minimal sample where the issue is reproducible: Kindly see the Loom video for a detailed demonstration of the issue
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It sounds like you’re encountering an issue with font embedding when adding new text to a PDF using WebViewer. The problem might stem from the way fonts are managed or embedded in the PDF when new text is added. WebViewer defaults to a standard font, such as Arimo, when it cannot find or embed the specified font.
Some things you can try:
Ensure that the fonts you want to use are properly loaded and available in your environment. You might need to use the Core.setFonts() method to load custom fonts.
Verify that the font files are correctly referenced and accessible by WebViewer.
Check if the PDF document allows embedding new fonts, as some PDF files may have restrictions.
Confirm that you are applying the font change correctly in the code, ensuring it targets the new text elements.