PDF rendering on a web page

We are trying to download a pdf file in a web browser using the pdfobject javascript api. Currently, the pdf we are trying to display is close to 10 MB. This creates a long delay in displaying the PDF file on the web page; while the full pdf is loading.

We need to remove this backlog by reaching any of the alternatives:

  • Show a progress bar until a PDF actually appears. We could not find the event that was triggered, and you can use it to find out if the PDF is currently visible. This does not allow us to decide when to stop showing the progress bar / spinner
  • OR Lazy loading a PDF so that it displays immediately after loading the first page. With this ateast, the user will have a visual indication that something is happening. We could not understand anything in the PDF object, which allows us to do a lazy load.
  • Custom Alternative Rendering pdf api; this is a low priority since we already have the full code; but in case the first 2 alternatives are not fulfilled; we would have to consider this option. Therefore, please feel free to offer.

Any other ideas on how user interaction can be more intuitive or enjoyable; We will welcome.

Greetings

+3
source share
3 answers
+2

3:

. pdf (100 ). Ghostscript jpeg/png . . : PDF- .

+1

Currently, browsers (and processors!) Are powerful enough to render PDF using only Javascript, and there is a project that uses this.

In particular, https://mozilla.imtqy.com/pdf.js/

0
source

Source: https://habr.com/ru/post/1739434/


All Articles