Skip to main content

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:

  1. Add PDF4me node to workflow
  2. Select "Linearize PDF" action
  3. Configure input parameters (see below)
Linearize PDF

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.

ParameterTypeDescriptionExample
Input Data Type***StringPDF 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 FieldBinaryBinary 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 ContentStringBase64 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 URLStringPublic 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***StringLinearized 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***StringSource PDF Reference
• Specify the name of the source PDF file
• For reference and tracking purposes
• Helps with processing tracking
document.pdf
Optimization Profile***EnumOptimization 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***StringBinary 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:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom 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

ParameterTypeDescriptionExample
successBooleanPDF4me 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 workflowstrue
messageStringPDF4me linearization completion message - Descriptive message indicating the status of the PDF linearization process. Provides clear feedback about the operation result for monitoring and debugging purposesPDF linearization completed successfully
fileNameStringPDF4me 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 processeslinearized_document.pdf
mimeTypeStringPDF4me 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 systemsapplication/pdf
fileSizeNumberPDF4me 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 automation23000
optimizeProfileStringPDF4me 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 optimizationweb
originalFileNameStringPDF4me 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 workflowsdocument.pdf
descriptionStringPDF4me 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 performancePDF 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 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"
}

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

Get Help