Enhance PDF viewing with linearized downloading

Linearized PDFs allow viewing a PDF while it’s still downloading, enabling faster access to information in the PDF. This is especially useful for large documents where quick access is critical.

Document Engine with streaming offers even more advantages, but sometimes linearized downloading is the best option.

Comparison

Document Engine streamingLinearized downloading
Fast initial page renderinggreen check icongreen check icon
Only requires HTTPS servergrey cross icongreen check icon
Read-write while downloadinggreen check icongrey cross icon
Only downloads the required datagreen check icongrey cross icon
Any PDF supported without preparationgreen check icongrey cross icon

Enable linearized downloading

PDFs are read-only until fully downloaded. This means that while you can see the information in a PDF, you cannot, for example, add an annotation until the PDF is fully downloaded.

  1. Prepare your PDF for linearization: This can be done using Nutrient’s Document Engine or .NET SDK. If you’re using other third-party tools, PDF linearization might be called fast web loading.
  2. Upload the linearized PDF to your HTTPS server.
  3. Add the allowLinearizedLoading: true option in PSPDFKit.load:
PSPDFKit.load({
container: "#container",
document: "https://example.com/path/to/linearized.pdf",
allowLinearizedLoading: true,
});

Check server support

Use curl to check if your server accepts range requests:

Terminal window
curl -I https://example.com/path/to/linearized.pdf -H "Range: bytes=0-1"

If the server supports range requests, you’ll see a 206 Partial Content response and an Accept-Ranges: bytes header.

Additional information

  • This is strictly a feature to speed up viewing a PDF while downloading. It won’t allow you to modify the PDF until it’s fully downloaded.
  • Linearized downloading only has an effect when a PDF is downloaded from an external web server.