12
Views
3
Comments
[Adobe PDF Embed API] User feedback whilst widget loading
adobe-pdf-embed-api
Reactive icon
Forge asset by Matthew Matias
Application Type
Reactive

Hi!

We use the Adobe PDF Embed API to load PDF's into our screen. For the most part it works really well, but I just have a question around loading and user feedback when using the ViewPDFBinary (I don't know if applies to the ViewPDFByLocation, as we don't use that one).

It seems that the binary data is retrieved very quickly, but it can take 5-10 seconds sometimes, for the PDF to become visible, and I'm not clear why that is. I don't mind this behaviour, it doesn't happen lots, but I would like users to be informed that the PDF is on it's way.

Normally, I'd use a feedback widget that showed when a boolean isLoading was True. I'd assign it true before the collection, and then false after the collection. However, the delay appears to be by the ViewPDFBinary loading, and not the associated data.

Is there a way round this?

Is there a way to monitor if a widget or container is fully finished loading instead? I've tried using the OnReady action, but again, that runs 5-10 seconds before the PDF actually becomes visible sometimes.

Thank you


Edit; I've made this video to demonstrate what I mean. The load times here aren't that bad, but you get the idea... Video.

2025-09-25 14-38-22
Lokesh Kumar Yadav

The delay you're seeing is due to the Adobe PDF Embed API rendering time, not the data fetch. Since OnReady fires when the DOM is ready—not when the PDF is fully rendered—you can’t rely on it alone. A better approach is to show a loading spinner until the Adobe PDF viewer's ready event is triggered. You can use Adobe's viewer events (ready, viewSDK-saved, etc.) to toggle your isLoading flag more accurately. 

2021-02-09 03-17-43
Matthew Matias

Hi Leigh,

Sorry for not replying to this earlier, I haven't been as active on this as much as I'd like. So little that I've lost my personal environment :(

Lokesh is right, this performance issue is from the PDF rendering. 

There's an update to the Adobe API that will allow for PDF linearization which will optimize PDFs for faster viewing by displaying the first page as quickly as possible.  

I'm in the process of porting this to ODC, and have been implementing the new API. I'll copy this over to O11 soon.

Matt

2021-11-22 00-14-28
Leigh Rogers

Thank you Matthew and Lokesh for your replies.

Since I last posted, I've spent some time trying to optimise the handling of varying rendering times on client machines, and haven't progressed at all I'm afraid.

Lokesh - can you explain a little more about how I use Adobe's viewer events? You mean the ones detailed here?, which includes a 'basic event' APP_RENDERING_DONE. The handling of these is not included in Matthews forge asset, and they're not part of the OS UI framework, so how do I use them?

Matthew - your asset is one of the most frequently used parts of my application. So although the load time is a relatively minor issue, I'm keep to optimise it and the UI handling as much as possible. Thank you for your work! I assume the linearisation wouldn't make any difference to locally obtained binary files? Because OS wouldn't pass any of the data to PDF viewer until it was all downloaded?

Thank you both very much

Leigh

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.