Skip to content

Loading gif image during pdf load #96

Open

Description

@rony4pm

Hi Guys,

Is there any implementation of loading status. As status bar, or just a simple loading gif?

Activity

  1. GaboDot commented on Sep 19, 2014

    @GaboDot

    It would be helpful, large pdf's take extra time to show complete... I hope we get an answer soon = )

  2. kossebau commented on Feb 12, 2015

    @kossebau
    Contributor

    There is no implementation yet, but I agree it would be good to have. Anyone up for coding one? :)

  3. Shreeshrii commented on Mar 24, 2015

    @Shreeshrii

    Is there any option that can be set for displaying first page after it has been downloaded and let the file continue downloading, rather than waiting for whole file to download?

  4. kossebau commented on Mar 24, 2015

    @kossebau
    Contributor

    Is there any option that can be set for displaying first page after it has been downloaded and let the file continue downloading, rather than waiting for whole file to download?

    No, nothing implemented at the moment to support that. Would be nice to have, agreed. But currently both the PDF and the ODF plugins only deal with complete files, so they have to be downloaded first completely.

  5. Shreeshrii commented on Mar 24, 2015

    @Shreeshrii

    ok. Thanks!

  6. vhugogarcia commented on Apr 17, 2015

    @vhugogarcia

    Any workaround or update to enable a loading alert or something.... ? thanks in advance

  7. frankiekam commented on May 27, 2015

    @frankiekam

    You mean like this?
    round
    I managed to solve it. The trick is to modify this code inside index.html:

    #canvasContainer {overflow: auto;padding-top: 6px;padding-bottom: 6px;position: absolute;top: 32px;right: 0;bottom: 32px;left: 0;text-align: center;background-color: #888;background-image: url(images/texture.png)}

    Specifically the "background-image:" part of the CSS. What you need to do is to change texture.png to an animated loading icon (i.e., an animated gif file), set the image to non-repeating and then set the image so that it appears in the centre of the screen. You can see it live in action here: http://www.cambridgekids.org/m29/course/view.php?id=2
    Login as guest. Anything is possible with programming. Endless possibilities. Cheers Frankie Kam, Malaysia.

  8. guidodo commented on Apr 17, 2016

    @guidodo

    In essence all that is needed (for PDF files) is to split up:

    PDFJS.getDocument(location).then(function loadPDF(doc) {

    and hook up a onProgress function:

    var pdfjsTask = PDFJS.getDocument(location);
    pdfjsTask.onProgress = function(obj) { ... }
    pdfjsTask.then(function loadPDF(doc) {
    

    Full patch (against source code) is attached. It'll show an overlay with a HTML5 progress bar during download.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions