0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

PDF → Compress PDF File

AI-generated

Overview

The node provides a utility to compress PDF files. It accepts either a public URL of a PDF or the binary buffer data of a PDF file as input, compresses the PDF to reduce its size, and then outputs the compressed PDF. Users can choose whether to receive the compressed PDF as a downloadable URL or as raw data.

This node is beneficial in scenarios where users need to optimize PDF files for faster sharing, reduced storage usage, or improved loading times on websites or applications. For example, it can be used to compress large PDF reports before emailing them or uploading to cloud storage.

Properties

Name Meaning
PDF URL Public URL of the PDF file to compress.
PDF Buffer Binary buffer data of the PDF file to compress.
Return as URL Whether to return the compressed PDF as a downloadable URL (true) or as raw data (false).
File Name Desired name for the output compressed PDF file.

Output

The node outputs the compressed PDF file. Depending on the "Return as URL" property:

  • If true, the output JSON contains a URL from which the compressed PDF can be downloaded.
  • If false, the output includes the compressed PDF data directly (likely as binary data).

The exact structure of the output JSON is not detailed in the source, but it will contain either a URL string or the binary content representing the compressed PDF.

Dependencies

  • Requires an API key credential for authentication with the external 0CodeKit service.
  • The node sends a POST request to the /pdf/compress endpoint of the 0CodeKit API at https://prod.0codekit.com.
  • No additional environment variables are explicitly required beyond the API key credential.

Troubleshooting

  • Common issues:

    • Providing both PDF URL and PDF Buffer empty or invalid will likely cause errors.
    • Network connectivity problems may prevent access to the external API.
    • Incorrect or missing API key credential will result in authentication failures.
    • If "Return as URL" is set to true but the service fails to generate a URL, the output might be empty or error out.
  • Error messages:

    • Authentication errors indicate invalid or missing API credentials; verify and re-enter the API key.
    • Validation errors if neither PDF URL nor buffer is provided; ensure one valid input is given.
    • API response errors related to file format or size limits; check that the input PDF meets service requirements.

Links and References

Discussion