Linearize PDF using n8n action
PDF4me Linearize PDF optimizes PDF documents for fast web viewing and progressive rendering through n8n automation workflows. Process PDFs via n8n triggers, binary data, base64 strings, or public URLs to reorganize PDF structure for page-at-a-time downloading, faster initial page display, improved browser performance, reduced wait times, and enhanced user experience in web applications and mobile devices. This solution is ideal for web-based PDF delivery, online document viewers, content delivery networks, mobile applications, e-learning platforms, and digital publishing workflows that require optimized PDF loading with improved performance and seamless integration.
Setup
Add the PDF4me "Linearize PDF" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.
Prerequisites:
- PDF4me API credentials
- n8n workflow access
Configuration:
- Add PDF4me node to workflow
- Select "Linearize PDF" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Linearize PDF action. Configure these parameters to control PDF linearization and optimization.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | PDF Input Format Selection • Choose the format of your PDF data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field | Binary | Binary PDF File Input (Required if Binary Data) • Reference PDF file from previous n8n node or file upload • PDF4me processes binary PDF files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Document Content | String | Base64 Encoded PDF Input (Required if Base64 String) • Provide PDF data as base64 encoded string • PDF4me automatically decodes and processes the PDF content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| File URL | String | Public PDF URL Input (Required if URL) • Provide a public/open permission URL to the PDF file • PDF4me downloads and processes the file from URL • Required when Input Data Type is "URL" | https://abc.com/sample.pdf |
| Output File Name*** | String | Linearized PDF Output Filename • Specify the name for the generated linearized PDF file • Must include .pdf extension • PDF4me ensures unique naming and format validation | linearized_document.pdf |
| Document Name*** | String | Source PDF Reference • Specify the name of the source PDF file • For reference and tracking purposes • Helps with processing tracking | document.pdf |
| Optimization Profile*** | Enum | Optimization Profile Selection • Choose the optimization profile for PDF linearization • Different profiles optimize for specific use cases (web, print, compression) • Options: Web, Max, Print, Default, WebMax, PrintMax, PrintGray, Compress, CompressMax • Essential for performance optimization | Web |
| Binary Data Output Name*** | String | Binary Data Output Mapping • Define the variable name for accessing generated linearized PDF binary data • Used in subsequent workflow actions • Essential for workflow automation | data |
Advanced Options
The following parameters are available in the Advanced Options section and are optional:
| Parameter | Type | Description | Example |
|---|---|---|---|
| Custom Profiles | String | Custom Configuration Profiles • Set additional options using custom profiles • JSON-like format containing predefined parameters • Enables advanced PDF linearization settings • Optional for specialized requirements | { "outputDataFormat": "base64", "preserveMetadata": true } |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | PDF4me linearization status indicator - Boolean flag indicating the success or failure of the PDF linearization process. PDF4me returns true for successful linearization and false for any errors, enabling robust error handling in automated workflows | true |
| message | String | PDF4me linearization completion message - Descriptive message indicating the status of the PDF linearization process. Provides clear feedback about the operation result for monitoring and debugging purposes | PDF linearization completed successfully |
| fileName | String | PDF4me generated linearized PDF filename - The complete filename of the successfully generated linearized PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processes | linearized_document.pdf |
| mimeType | String | PDF4me linearized PDF MIME type - The MIME type of the generated linearized PDF file, indicating the file format for proper handling in web applications and file systems | application/pdf |
| fileSize | Number | PDF4me linearized PDF file size in bytes - The exact size of the generated linearized PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation | 23000 |
| optimizeProfile | String | PDF4me optimization profile used - Indicates the optimization profile that was applied during the linearization process. Shows which profile (web, max, print, default, webmax, printmax, printgray, compress, compressmax) was used for the optimization | web |
| originalFileName | String | PDF4me source PDF reference - The original PDF filename that was processed by PDF4me's linearization engine. This reference is maintained for audit trails, debugging purposes, and tracking the source of generated linearized documents in enterprise workflows | document.pdf |
| description | String | PDF4me linearization result description - Detailed description of the linearization result, explaining the optimization applied and benefits achieved. Provides context about the linearization process and its impact on document performance | PDF is now optimized for web viewing and faster loading |
N8N Action Response
The PDF4me Linearize PDF 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:
{
"success": true,
"message": "PDF linearization completed successfully",
"fileName": "linearized_document.pdf",
"mimeType": "application/pdf",
"fileSize": 23000,
"optimizeProfile": "web",
"originalFileName": "document.pdf",
"description": "PDF is now optimized for web viewing and faster loading"
}
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| success | true |
| message | PDF linearization completed successfully |
| fileName | linearized_document.pdf |
| mimeType | application/pdf |
| fileSize | 23000 |
| optimizeProfile | web |
| originalFileName | document.pdf |
| description | PDF is now optimized for web viewing and faster loading |
Schema View
The data structure and types of the response:
1 item
success: ☑ true
message: AB PDF linearization completed successfully
fileName: AB linearized_document.pdf
mimeType: AB application/pdf
fileSize: # 23000
optimizeProfile: AB web
originalFileName: AB document.pdf
description: AB PDF is now optimized for web viewing and faster loading
Type Indicators:
AB= String#= Number☑= Boolean
Binary Data View
The actual linearized PDF file data and metadata:
data
─────────────────────────────
File Name: linearized_document.pdf
File Extension: pdf
Mime Type: application/pdf
File Size: 240.0 KB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
Web Publishing and Online Distribution
- Linearize PDF documents for web publishing, online distribution, and streaming delivery to enable fast loading, progressive rendering, and improved user experience
- Process large PDF documents, reports, and publications by linearizing them for web-based viewing, mobile access, and online document sharing
- Transform PDF catalogs, brochures, and marketing materials to linearized format for web publishing, e-commerce integration, and online customer access
Mobile and Cross-Platform Compatibility
- Linearize PDF documents for mobile devices, tablets, and cross-platform compatibility to ensure consistent viewing experience across different devices and operating systems
- Process PDF documents with complex layouts, graphics, and multimedia content by linearizing them for mobile optimization and responsive viewing
- Transform PDF presentations, reports, and documents to linearized format for mobile-first distribution, app integration, and cross-platform accessibility
Performance Optimization and Streaming
- Linearize PDF documents for performance optimization, faster loading times, and improved streaming capabilities for large documents and multimedia content
- Process PDF documents with embedded media, interactive elements, and complex graphics by linearizing them for optimized web delivery and streaming
- Transform PDF documents for content delivery networks (CDNs), web applications, and streaming platforms to ensure optimal performance and user experience