Rendering PDF on WebPage

Posted by Priyank on Stack Overflow See other posts from Stack Overflow or by Priyank
Published on 2010-04-01T08:27:07Z Indexed on 2010/04/01 13:13 UTC
Read the original article Hit count: 442

Hi.

We are trying to load a pdf file in web browser using pdfobject javascript api. Currently the size of the pdf's that we are trying to display is close to 10MBs. This creates a long delay in displaying a PDF on web page; while the complete PDF gets downloaded.

We need to remove this lag by achieving either of the alternatives:

  • Show a progress bar until the PDF is actually displayed. We couldn't find an event which is triggered and can be used to find out if pdf is visible now. This lacking doesn't let us decide when to stop showing progress bar/spinner
  • OR lazy load the PDF such that it gets displayed as soon as first page gets loaded. With that ateast user will have a visual indication as to something is happening. We couldn'find anything in pdf object that lets us do a lazy load.
  • User alternative pdf rendering api; this is a low priority as we already have complete code in place; but in an event of first 2 alternatives not being met; we'd have to consider this option. So please feel free to suggest.

Any other ideas as to how user interaction can be made more intuitive or pleasant; would be welcome.

Cheers

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about pdf