PDF files can be of different sizes. We have seen files as small as 1-2MB and up to 100s of MB. Serving big files is a challenge that needs to be handled in a managed way, luckily PDFs can have Linearized structure which enables Partial loading feature. PDF Partial Loading is a feature that allows you to load only the first few pages of a PDF file. This can be useful when you want to display a preview of the document, but don’t want to wait for the entire file to load. It also helps in reducing bandwidth usage and server load.

What is Partial Loading of PDF?

The terms “Web Optimized” and “PDF Fast Web View” refer to the technical concept of a linearized PDF, which was introduced in PDF version 1.2. Linearization enables partial loading, allowing PDF files to load incrementally as they are viewed.

PDFs can be loaded in small chunks, similar to streaming videos or music. This means you can jump to a specific section of a large PDF, and only that portion will load, making it much faster to view on the web.

Technically, a linearized PDF is a special format designed for faster web viewing. It contains structured data that allows a byte-streaming server to deliver the PDF one page at a time. Without linearization or byte-streaming support, the entire PDF must be downloaded before it can be viewed.


How to enable Partial Loading in PDF?

Use a Linearized PDF

Ensure your PDF is exported in Web/Online format rather than for print. Most modern PDF export tools automatically create linearized PDFs that support partial loading.

Use a Byte-Streaming Enabled Server

Confirm that your server supports byte-streaming. This allows the PDF to be delivered one page at a time, enabling faster and more efficient loading.


Why Isn’t Partial Loading Working for My PDF?

Based on extensive experience with JavaScript and WordPress PDF plugins, several common issues can prevent partial loading from functioning correctly:

Compressed PDF Files

PDFs are already compressed, so additional compression (like zipping) can block partial loading.

Solution: Exclude PDF files from server-side compression using .htaccess rules or hosting settings.

Partial Loading not supported by server!

Some servers, particularly nginx, do not support partial loading as efficiently as Apache.

Solution: Serve PDFs through an Apache server or configure nginx with proper proxy settings to enable partial loading.

Non-Linearized PDF!

You have exported PDF with web export setting. Yet your exported may not create a linear PDF. We use WorkerPDF to convert the PDFs to ebook export.

Required Headers!

Some server do not provide enough headers. So we need to add it.

Amazon s3

Update this under S3 ->Buckets -> Permissions -> CORS

[
    {
        "AllowedHeaders": [
            "Authorization",
            "Range"
        ],
        "AllowedMethods": [
            "HEAD",
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "Accept-Ranges",
            "Content-Encoding",
            "Content-Length",
            "Content-Range"
        ],
        "MaxAgeSeconds": 3000
    }
]

We will keep adding any further finding to this topic. Till then Happy Flipping!!