Create custom font for japanese characters without XHR

WebViewer Version: 8.11.0

Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? N/A
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? Angular related
Is your issue related to annotations? No

Please give a brief summary of your issue:
(Think of this as an email subject)

We want to create watermarks and to be able to use japanese characters in the watermarks.
We were able to do this by adding japanese characters to the existing font:

const document = await instance.Core.documentViewer.getDocument().getPDFDoc();
const initialFont = await pdfNet.Font.create(document, pdfNet.Font.StandardType1Font.e_courier);
const fontWithAllTextChars = await pdfNet.Font.createFromFontDescriptor(document, initialFont, text);
await stamper.setFont(fontWithAllTextChars);

The problem here is that pdftron makes a http request to

and we have a policy that doesn’t allow loading font from the web and we get this error:

refused to connect to ‘’ because it violates the following Content Security Policy directive: “default-src ‘self’”. Note that ‘connect-src’ was not explicitly set, so ‘default-src’ is used as a fallback

Is there a way to use japanese characters without making http requests?

Thank you!


Thank you for contacting WebViewer Support. You should be able to self serve fonts instead of having WebViewer try to access the default fonts.json file. You can see the following guide for more information about how to self serve fonts

Please let me know if the above helps or if you want me to clarfy something

Best Regards,

Andrew Yip
Web Developer