Linearize PDF
Convert → Linearize PDF
The Linearize PDF API optimizes a PDF for web viewing (faster loading, progressive display). You send the PDF as Base64 (docContent), docName, optimizeProfile (e.g. web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax), and IsAsync. The API returns the linearized PDF (or 202 + Location for async). Use the tester below to try it; more details are in the sections that follow.
Try the Linearize PDF API
Endpoint: POST /api/v2/LinearizePdf · Required: api-key, docContent, docName, optimizeProfile, IsAsync
Use the form below to send your API key and PDF (Base64). Set optimization profile (e.g. web); the response is the linearized PDF (or polling URL when async). No code required—fill the fields and click Send request.
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Linearize PDF?
This endpoint linearizes a PDF for web viewing: faster loading and progressive display (content appears as it downloads). You provide the PDF (Base64), docName, optimizeProfile (web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax), and IsAsync. The API returns the linearized PDF or a Location URL for async.
Key features
- Progressive display – Linearized PDFs display progressively as they download.
- Profiles – web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax.
- Async – IsAsync returns 202 with Location URL for polling.
Use when you need PDFs optimized for web or online viewing. For archival use Create PDF/A; for smaller file size use Compress PDF in Optimize.
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64). |
| docName | string | Yes | Output file name (e.g. output.pdf). |
| optimizeProfile | string | Yes | web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax. |
| IsAsync | boolean | Yes | Enable asynchronous processing. |
When to use Linearize PDF
- Web viewing – Optimize PDFs for web or online document viewers.
- Progressive display – Enable progressive loading for large PDFs.
- Pipelines – Use after conversion or editing before web distribution.
For request/response schemas and code samples, see Linearize PDF in the PDF4me API docs.
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF document in Base64 format
Response Format
The API returns a linearized PDF document:
- Status 200: PDF linearization completed immediately - binary PDF content in response body
- Status 202: Request accepted and processing asynchronously - use the Location header URL to poll for results
For asynchronous requests, poll the Location URL until status 200 is returned with the linearized PDF document.