Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get notified when the document finishes loading #60

Open
mgodbole opened this issue Sep 19, 2024 · 1 comment
Open

Get notified when the document finishes loading #60

mgodbole opened this issue Sep 19, 2024 · 1 comment

Comments

@mgodbole
Copy link

Hi @paodb
I am using the PDFViewer to load a PDF document from a remote server, using the following

StreamResource resource = new StreamResource("Some file name", () -> {
            try {
                return new URI(PDF_URL).toURL().openStream();
            } catch (Exception e) {
                LOGGER.error(e.getLocalizedMessage(), e);
                return null;
            }
        });

        PdfViewer pdfViewer = new PdfViewer();
        pdfViewer.setSrc(resource);
        pdfViewer.setSizeFull();
        add(pdfViewer);

If the document is large in size, I noticed the UI just shows up blank, waiting for the document to load.
To improve usability, I would like to show an indeterminate ProgressBar.
Is there any way to find out when the loading has finished? I couldn't find any reliable method in the PDFViewer or StreamResource.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@mgodbole and others