Flash of Unstyled Text if Source Pdf has embedded subset font

Hi GroupDocs Support,

I encountered an issue when previewing a PDF file using GroupDocs.Viewer.

The problem appears to occur because the PDF contains an embedded subset font in Base64 format. The browser needs to decode the Base64 before the font can be used, which results in a brief flash of unstyled text.

Steps to Reproduce:

  1. Open this file (
    GroupDocs Example.pdf (149.5 KB)) using GroupDocs.Viewer
  2. You can reproduce this issue easier by reducing your browser’s CPU performance (You can reduce it in Developer Tools > Performance Tab)
  3. You should be able to see the unstyled text appear briefly.

Reference:
Before Font:
Before.png (6.9 KB)

After Font:
After.png (8.7 KB)

@Nifil

Hi Nicholas,

Unfortunately I was not able to reproduce the flashing of the unstyled text. Here is what I did:

  1. Took your GroupDocs Example.pdf (149.5 KB) document and rendered it to HTML with default settings (HtmlViewOptions.ForEmbeddedResources).
  2. Opened produced HTML file in a Google Chrome, in the “Performance” tab of the Developer tools selected a CPU: 20x slowdown setting, and reloaded the page.
  3. I was not able to observe flashing of unstyled text. At the first stage, browser draws the black horizontal table lines, and after a moment the final text appears.

Please share the HTML file, where you can observe such effects.

Also, I can suggest you to exclude fonts. Set the HtmlViewOptions.ExcludeFonts = true and re-generate HTML - all fonts will be excluded from the resultant HTML, and browser will use only the system fonts.

With best regards and waiting for your reply,
Denis Gvardionov

@denisgvardionov
Hi Denis, sorry for the late reply.

I was able to successfully reproduce the issue using your GitHub demo code GroupDocs.Viewer-for-.NET/Demos/ASP.NET MVC at master · groupdocs-viewer/GroupDocs.Viewer-for-.NET · GitHub. I’ll share the HTML file from that project with you. Additionally, I’ll include a video showing how I reproduced the issue to make it clearer. Thank you

Note:
I want to use the font embedded in the file, so I can’t use ExcludeFonts property

Attachment:
GroupDocs.Viewer FOUT Issue.zip (1.0 MB)

@Nifil

We have created the issue in our internal bug-tracker for further analysis. The issue ID for reference is VIEWERNET-5546.

For now, I can say that this is rather expected behavior due to the fact that the fonts have to be loaded and applied by a browser, but this is results in not the best user experience.

You would like to see a loader and a fully loaded page when all the resources are processed by a browser, is that correct?

Thanks

@vladimir.litvinchik

Hi Vladimir,

Yes, that’s the expected result for my case — the loading screen should remain visible until all resources have been fully processed by the browser, so that unstyled text doesn’t flash on the screen.

For my reference, may I know approximately when this issue will be fixed?

Thank you.

@Nifil

Thank you for the feedback! Let us take a look at the issue and possible solutions, so we could share next steps.