Skip to main content

Linearize PDF - Web Optimization API

PDF4me Linearize PDF is a powerful enterprise-grade solution that optimizes PDF documents for web viewing through advanced API integration. This comprehensive linearization service restructures PDF files for faster loading and progressive display—content becomes visible as it downloads rather than waiting for the entire file. The API processes PDF linearization by receiving source PDF files through REST API calls, utilizing advanced optimization technology for web-friendly output. With support for multiple optimization profiles (web, print, compression) and synchronous or asynchronous processing, this solution is ideal for web applications, content delivery networks, document portals, and enterprise platforms that require reliable, scalable PDF web optimization with improved user experience and reduced perceived load times.

Authenticating Your API Request

To access the PDF4me REST API, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user of the REST API.

Key Features

  • Progressive Web Display: Linearized PDFs display content progressively as they download, improving perceived performance
  • Faster First-Byte Display: Optimized structure allows browsers and viewers to show initial pages quickly
  • Multiple Optimization Profiles: Support for web, print, compression, and custom profiles (web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax)
  • Synchronous & Asynchronous Processing: Choose immediate response or async processing for large files
  • Web & CDN Ready: Output optimized for web servers and content delivery networks
  • Seamless API Integration: RESTful API designed for automated workflows and enterprise system integration

REST API Endpoint

The PDF4me REST API uses standard HTTP methods to interact with resources. All PDF linearization operations are performed through a single endpoint:

  • Method: POST
  • Endpoint: /api/v2/LinearizePdf

Linearization Capabilities

The API provides comprehensive PDF linearization for different use cases:

Web Optimization

  • Web Profile: Optimize for fast web viewing and progressive display
  • WebMax: Maximum web optimization for best online viewing experience
  • Progressive Loading: Enable viewers to display content before full download completes
  • Print Profile: Optimize for print quality while maintaining structure
  • PrintMax / PrintGray: Advanced print-oriented optimization options
  • Compress / CompressMax: Reduce file size with compression-focused profiles

Processing Modes

  • Synchronous: Receive linearized PDF immediately in response (suitable for smaller files)
  • Asynchronous: Request accepted (202); poll Location URL until status 200 for result (suitable for larger files)

REST API Parameters

Complete list of parameters for the Linearize PDF REST API. Parameters are organized by category for better understanding and implementation.

Important: Parameters marked with an asterisk (*) are required and must be provided for the API to function correctly.

Required Parameters

ParameterTypeDescriptionExample
File Content*Base64The content of the input PDF fileJVBERi...
File Name*StringSource PDF file name with .pdf extensiondocument.pdf
Optimize Profile*StringOptimization profile to apply. Allowed values: web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMaxweb
Is Async*BooleanIf true, request is processed asynchronously; use Location header URL to poll for result. If false, linearized PDF is returned in response body.true

Output

The PDF4me Linearize PDF REST API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API (synchronous) or reference to async result:

{
"File Content": "Output file content from the PDF4me Connect"
}

For asynchronous requests (IsAsync: true), the API returns 202 Accepted with a Location header. Poll that URL until status 200 is returned with the linearized PDF content.

Request Example

Content-Type: application/json
Authorization: YOUR_API_KEY

Note: Get your API key from the PDF4me Dashboard

Payload

{
"docContent": "Please put PDF base64 content",
"docName": "document.pdf",
"optimizeProfile": "web",
"IsAsync": false
}

Code Samples

The PDF4me Linearize PDF REST API provides code samples in multiple programming languages. Choose the language that best fits your development environment:

C# (CSharp) Sample

Complete C# implementation for linearizing PDF documents:

Linearize PDF Features

Web Performance

  • Progressive Display: Content visible before full download completes
  • Fast First Page: Optimized structure for quick first-byte display
  • CDN Friendly: Output suitable for content delivery networks and web servers
  • Browser Optimized: Works with built-in browser PDF viewers and embedded viewers

Document Processing

  • Structure Preservation: Maintain PDF structure and visual appearance
  • Multiple Profiles: Choose web, print, or compression-focused optimization
  • Sync & Async: Support for immediate or background processing
  • Quality Assurance: Reliable output for enterprise document delivery

Industry Use Cases & Applications

Web & Document Portals

  • Document Portals: Linearize PDFs for fast loading in document management and knowledge base portals
  • E-Learning: Optimize course materials and PDFs for progressive display in learning platforms
  • Online Catalogs: Fast-loading product catalogs and brochures for e-commerce and marketing sites
  • Legal & Compliance: Publish policies and compliance documents for quick web viewing

Get Help