Skip to content
This repository was archived by the owner on Jul 28, 2021. It is now read-only.

Conversation

@Lesik
Copy link
Contributor

@Lesik Lesik commented Dec 28, 2017

As discussed with @Tommy-Geenexus in #7, this PR implements an onDocumentLoaded callback that enables document-related menu items such as printing.

One thing I'm not 100% happy with is that the callback is run a lot earlier than when the whole page is actually rendered. Maybe @Tommy-Geenexus can help?

@paride
Copy link
Owner

paride commented Dec 29, 2017

Thanks @Lesik. Let's see if @Tommy-Geenexus chimes in, otherwise I'll merge this as it is, if you agree.

@Tommy-Geenexus
Copy link

@Lesik @paride I will take a look over the course of the weekend, when i'm free.

@Tommy-Geenexus
Copy link

@Lesik @paride

Sorry for the delay.
There is a way to catch page rendering when its finished; below is a sample on how it could be implemented via a js callback (in viewer.js).

var renderTask = page.render(renderContext);

    renderTask.promise.then(function () {
        channel.onPageLoaded(); <- Implement callback here
        pageRendering = false;
        if (pageNumPending !== null) {
            renderPage(pageNumPending);
            pageNumPending = null;
        }
    });

I can't contribute code atm, as i'm very busy, but i hope this helps.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants