downloadPdf content issue

WebViewer Version:

10.9.0

Do you have an issue with a specific file(s)?

Yes

Can you reproduce using one of our samples or online demos?

No, the online demo cannot preview Song typeface normally.

Are you using the WebViewer server?

No

Does the issue only happen on certain browsers?

I conducted tests on Chrome, Firefox, and Edge, and all encountered the same issue.

Is your issue related to a front-end framework?

No

Is your issue related to annotations?

No

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

The content of the file downloaded using the downloadPdf function is inconsistent with the preview content.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

I have an xls file that displays normally in preview, but the downloaded pdf file using the downloadPdf function contains unreadable characters. The font of the unreadable characters is Song typeface.

I tried upgrading WebViewer to version 12.1.0, but the same issue occurred.

The image below shows the content displayed during preview:

The image below is the display content of the downloaded PDF file:

Original file:

TEST-song.xls (18 KB)

1 Like

Hello Chang Ren,

Thank you for contacting WebViewer Forums.

When downloading the XLS file, WebViewer makes a conversion to PDF and needs access to the fonts used in the original document, otherwise it will use the default font substitution fallback. You can either:

  1. Embed the font into the document
  2. Use font substitution as outlined in this documentation here: Self serving substitute fonts | Apryse documentation

Please let me know if you have any further questions.

Regards,
Luke

1 Like

Hello Luke

Thank you for your reply.

  1. I don’t know how to embed a font file into an XLS file.
  2. I have tested using Self-serving substitute fonts, but it didn’t work. It only took effect in the preview of this file.
  3. You mentioned use the default font. Can I specify the default font through configuration?

If it’s due to an unrecognized font issue, then why does it display normally during preview but appears as messy code when downloaded? What I’m puzzled about is that, as shown in the screenshot, not all Song typeface text encounters this issue.

Regards,
Chang

1 Like

Hello Chang,

Thank you for your reply.

Downloading is part of a conversion process to PDF and handles fonts differently from viewing it. You will need to supply the font with font substitution if it isn’t embedded in the document. To investigate, can you provide the WebFonts you used for font substitution?

Regards,
Luke

Hello Luke

Thank you for your reply.

You can use Self serving substitute fonts for inspection, as it also exhibits the same issue.

https://pdftron.s3.amazonaws.com/downloads/SelfServeWebFontsV2.zip

Regards,
Chang