How i can open pdf uploaded by user (dynamically )

WebViewer Version:11.2.0

Do you have an issue with a specific file(s)?
I want to open dynamic pdf viewer
Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server? yes
Does the issue only happen on certain browsers?no
Is your issue related to a front-end framework? yes
Is your issue related to annotations? no

Please give a brief summary of your issue:
(Think of this as an email subject)
How can I dynamically open a PDF in a WebViewer based on user selection?

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
I have created a UI with a sidebar where users can select a PDF file. Once a file is selected, I want the chosen PDF to be displayed dynamically in the WebViewer. I am using PDFTron’s WebViewer for this purpose. Which specific code examples or documentation sections can help me load the PDF into the WebViewer dynamically as soon as it is selected? Any guidance on managing the file input and rendering it in the viewer would also be appreciated.

Please provide a link to a minimal sample where the issue is reproducible:

1 Like

Hi there,

This viewing sample is an example of how a user can upload a file from the left panel and display it on WebViewer:
https://sdk.apryse.com/samples/web/samples/viewing/viewing/

This example is also available if you download the WebViewer package here:

The relevant WebViewer code is simply calling instance.UI.loadDocument API for the uploaded file. Please see this guide for more information:

Best regards,
Kevin

1 Like