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 & Compression
- 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
| Parameter | Type | Description | Example |
|---|---|---|---|
| File Content* | Base64 | The content of the input PDF file | JVBERi... |
| File Name* | String | Source PDF file name with .pdf extension | document.pdf |
| Optimize Profile* | String | Optimization profile to apply. Allowed values: web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax | web |
| Is Async* | Boolean | If 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
- Table
- Schema
- Binary
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.
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| File Content | Output file content from the PDF4me Connect |
Schema View
The data structure and types of the response:
1 item
File Content: AB Output file content from the PDF4me Connect
Type Indicators:
AB= String
Binary Data View
The actual linearized PDF file data and metadata:
data
─────────────────────────────
File Content: Output file content from the PDF4me Connect
Binary Data Access:
- Linearized PDF Content: Ready for download or web delivery
- Web Optimized: Structured for progressive loading and fast first-byte display
Request Example
Header
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#
- Java
- JavaScript
- Python
- Salesforce
- n8n
- Google Script
- AWS Lambda
Google Script Sample
Google Apps Script implementation for Google Workspace integration:
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
- Publishing & Media
- Enterprise & SaaS
- Government & Public Sector
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
Publishing & Media
- Digital Publishing: Optimize e-books and digital magazines for web and app viewing
- News & Reports: Fast-loading reports and whitepapers for reader experience
- Documentation: Technical and user documentation for progressive web display
- Archives: Web-accessible archives with improved load times
Enterprise & SaaS
- SaaS Applications: Integrate linearized PDF delivery in document-heavy applications
- CRM & ERP: Optimize invoice and report PDFs for in-app viewing
- HR & Onboarding: Fast-loading policy and onboarding documents
- Compliance: Publish regulatory and audit documents for quick access
Government & Public Sector
- Public Records: Optimize public records and forms for citizen portals
- E-Government: Fast-loading forms and guides on government websites
- Transparency: Publish reports and data as linearized PDFs for quick access
- Archival Access: Web-friendly access to archived documents