Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Split PDF By Barcode
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Split PDF By Swiss QR
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
This node provides PDF compression functionality, allowing users to reduce the file size of PDF documents. It supports multiple input methods for providing the PDF file: as binary data from a previous node, as a base64 encoded string, or via a URL pointing to the PDF file. Users can specify an optimization profile tailored for different use cases such as web display, printing, or screen viewing. The node also supports asynchronous processing to handle potentially long-running compression tasks efficiently.
Common scenarios where this node is beneficial include:
- Reducing PDF file sizes before sending them via email or uploading to cloud storage.
- Optimizing PDFs for faster loading on websites or mobile devices.
- Preparing PDFs for printing with higher quality settings.
- Automating document workflows that require compressed PDFs to save bandwidth and storage.
Practical example:
- A user receives large PDF reports from various sources and wants to compress them automatically before archiving or sharing. They can feed the original PDFs into this node, select the "Web" optimize profile for smaller size, and output compressed PDFs ready for distribution.
Properties
| Name | Meaning |
|---|---|
| Input Data Type | Choose how to provide the PDF file to compress. Options: Binary Data, Base64 String, URL |
| Input Binary Field | (If using Binary Data) Name of the binary property containing the PDF file |
| Base64 PDF Content | (If using Base64 String) Base64 encoded content of the PDF file |
| PDF URL | (If using URL) URL pointing to the PDF file to compress |
| Output File Name | Desired name for the output compressed PDF file |
| Optimize Profile | Compression optimization profile. Options: Web, Print, Screen |
| Async | Enable asynchronous processing (true/false) |
| Binary Data Output Name | Custom name for the binary data in the node's output (default is "data") |
Output
The node outputs the compressed PDF file as binary data under the specified binary data output name (default "data"). The JSON output contains metadata about the operation and references to the binary data. The binary data represents the compressed PDF file ready for further use or download.
Dependencies
- Requires access to an external PDF compression service or API (implied by the imported action module for compressing PDFs).
- Needs appropriate API credentials configured in n8n to authenticate requests to the PDF compression service.
- Network access to fetch PDFs if using the URL input method.
Troubleshooting
Common issues:
- Providing an invalid or inaccessible URL will cause failures when fetching the PDF.
- Incorrect base64 encoding or corrupted binary data may result in errors during compression.
- Missing or misnamed binary property fields can lead to the node not finding the input PDF.
- API authentication failures due to missing or incorrect credentials.
Error messages and resolutions:
- "Failed to fetch PDF from URL": Check the URL validity and network connectivity.
- "Invalid PDF content": Verify the input data format and encoding.
- "Authentication error": Ensure API credentials are correctly set up in n8n.
- "Binary property not found": Confirm the binary field name matches the input data.
Links and References
- PDF Compression Concepts
- Base64 Encoding Explained
- n8n Documentation on Binary Data Handling
- External PDF compression service documentation (specific link depends on the service used; not provided in source)