Data streaming in pdfTrone

WebViewer Version:

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

Please give a brief summary of your issue:
(Think of this as an email subject)
Hi everyone, I’m using PDFTron WebViewer to load a linearized PDF via HTTP 206 Partial Content with streaming: true and fullAPI: false.

:white_check_mark: Chunks are loading in the Network tab correctly
:cross_mark: But the first page does not render immediately — it only displays after most or all chunks are loaded.

My goal is to render the first page right after the initial chunk is downloaded, while remaining chunks load in parallel.

WebViewer Version: 10.2.3

  • Server supports range requests and returns 206 Partial Content
  • File served with headers: Accept-Ranges, Content-Range, Content-Disposition: inline

How can I force WebViewer to display the first page or first chunk immediately after the first chunk, rather than waiting for additional chunks or full file download?

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

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

1 Like

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It sounds like you’re trying to optimize the loading experience for a linearized PDF file using PDFTron’s WebViewer. The goal is to have the first page render as soon as possible, even while the rest of the document is still downloading. WebViewer supports this functionality, but there are a few things you might want to check and configure to achieve the desired behavior.

Some things you can try:

  • Ensure that your PDF is properly linearized. A linearized PDF is optimized for page-at-a-time loading, which should allow the first page to display faster.

  • Verify that your server correctly supports HTTP range requests. This is crucial for partial content loading and displaying pages as they are downloaded.

  • Consider using the shouldUseMinimumDownloads option, which is designed to only download necessary data for the current and nearby pages.

  • Check if your WebViewer configuration is set correctly, particularly the streaming and fullAPI options, to ensure they are functioning as intended.

  • Ensure that the network conditions and browser settings are not affecting the loading performance, as different browsers may handle HTTP 206 requests differently.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

1 Like

Hello Megha,

Do you have a sample file you can provide to test this? Are you able to reproduce this issue on our Showcase?

Best Regards,
Darian

1 Like