---
title: "Server-based PDF linearization for faster PDF viewing | Nutrient"
canonical_url: "https://www.nutrient.io/guides/document-engine/optimization/linearize/"
md_url: "https://www.nutrient.io/guides/document-engine/optimization/linearize.md"
last_updated: "2026-06-12T08:07:55.127Z"
description: "Server-Based PDF Linearization for Faster PDF Viewing | guide for Nutrient Document Engine SDK with detailed instructions and code examples."
---

# Create linearized PDFs

You can linearize PDFs using Document Engine. For background on what linearization is and how it compares to a standard PDF, see our [linearized PDF blog post](https://www.nutrient.io/blog/linearized-pdf.md).

## PDF linearization

A linearized PDF file is organized in a special way to enable efficient incremental access in a network environment. Enhanced viewer applications can recognize that a PDF file has been linearized and take advantage of that organization.

To linearize a PDF, use the following example:

### SHELL

```shell

curl -X POST http://localhost:5000/api/build \
  -H "Authorization: Token token=<API token>" \
  -F document=@/path/to/example-document.pdf \
  -F instructions='{
  "parts": [
    {
      "file": "document"
    }
  ],
  "output": {
    "type": "pdf",
    "optimize": {
      "linearize": true
    }
  }
}' \
  -o result.pdf

```

### HTTP

```http

POST /api/build HTTP/1.1
Content-Type: multipart/form-data; boundary=customboundary
Authorization: Token token=<API token>

--customboundary
Content-Disposition: form-data; name="document"; filename="example-document.pdf"
Content-Type: application/pdf

<PDF data>
--customboundary
Content-Disposition: form-data; name="instructions"
Content-Type: application/json

{
  "parts": [
    {
      "file": "document"
    }
  ],
  "output": {
    "type": "pdf",
    "optimize": {
      "linearize": true
    }
  }
}
--customboundary--

```

## Licensing

To linearize PDFs with Document Engine, the Linearization feature needs to be included in your license. [Contact Sales](https://www.nutrient.io/company/contact) to add linearization to your license. After the new component is added to your license, update the license or activation keys in your configuration.

## Other types of PDF compression

You can perform both linearization and compression in a single request to `/api/build` if both features are enabled in your license:

```json

instructions = {...
  output: {
    type: "pdf",
    optimize: {
      grayscaleText: true,
      grayscaleGraphics: true,
      grayscaleFormFields: true,
      grayscaleAnnotations: true,
      disableImages: true,
      mrcCompression: true,
      imageOptimizationQuality: 2,
      linearize: true,
    }
  }
}

```

To learn more about other types of compression supported by Document Engine, refer to the [PDF compression](https://www.nutrient.io/guides/document-engine/optimization/compress.md) guide.
---

## Related pages

- [Compress and reduce PDF file size](/guides/document-engine/optimization/compress.md)
- [PDF compressor server](/guides/document-engine/optimization.md)
- [Hyper-compress](/guides/document-engine/optimization/hyper-compress.md)
- [PDF annotation flattening](/guides/document-engine/optimization/flatten.md)

