Actions108
- AI Actions
- Transcribe
- Detect Brand
- Extract Contact Information
- Mood Detection
- Detect Adult Content
- Enitity Detection
- Language Detection
- Too Long To Read
- Check Content Policy
- Detect Faces
- Generate Python Code
- Picture Text Recognition
- Detect Color
- Generate Image
- PDF OCR
- Translation
- Detect Email Type
- Generate Javascript Code
- Picture Object Recognition
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
Overview
The "Compress PDF" operation of the PDF resource in this node allows users to reduce the file size of a PDF document. This is useful when you need to optimize PDFs for faster sharing, reduce storage space, or meet upload size limits on platforms.
Typical use cases include:
- Compressing large PDF reports before emailing.
- Reducing scanned PDF sizes for archiving.
- Optimizing PDFs for web publishing.
Users can provide the PDF either as a public URL or as binary data (buffer). The node processes the input and outputs the compressed PDF, optionally returning it as a URL.
Properties
| Name | Meaning |
|---|---|
| Datatype | Choose whether the input PDF is provided as a URL or as Binary Data (buffer). |
| URL | Public URL of the PDF file to compress (required if Datatype is URL). |
| Binary Data | Buffer containing the PDF file to compress (required if Datatype is buffer). |
| Filename | Optional filename for the output PDF. |
| Get File as URL | Boolean flag indicating whether the output PDF should be returned as a URL instead of raw data. |
Additional properties related to code variables exist but are not relevant for this operation.
Output
The node outputs a JSON array where each item represents the result of the compression operation. The key output field is:
json: Contains the compressed PDF data. Depending on the "Get File as URL" property, this will either be:- A URL pointing to the compressed PDF file.
- The compressed PDF content in binary form.
If binary data is output, it represents the compressed PDF file ready for further processing or saving.
Dependencies
- Requires an API key credential for authentication with the external service that performs the PDF compression.
- The node relies on an external API endpoint corresponding to the PDF compress operation.
- No additional environment variables are explicitly required beyond the API key credential.
Troubleshooting
- Invalid URL or inaccessible PDF: If the provided URL is incorrect or the PDF is not publicly accessible, the node will fail. Ensure the URL is valid and reachable.
- Incorrect datatype selection: Providing binary data while selecting URL as datatype (or vice versa) will cause errors. Match the datatype property with the actual input.
- Missing required properties: Omitting required fields like URL or buffer depending on datatype will cause errors.
- API authentication errors: Ensure the API key credential is correctly configured and has permissions for PDF operations.
- Large files timeout: Very large PDFs might cause timeouts or failures due to API limits; consider splitting the PDF first.
Links and References
- n8n Expressions Documentation
- General PDF compression concepts: https://en.wikipedia.org/wiki/PDF_compression
- External API documentation (not included here) would provide details on compression options and limits.