0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions114

PDF → Compress PDF

AI-generated

Overview

This node operation compresses PDF files. It supports input PDFs provided either as a URL or as binary data (buffer). Users can specify the filename for the output PDF and choose whether to receive the compressed PDF as a URL or as binary data. This operation is useful for reducing the file size of PDFs to save storage space or facilitate faster sharing and uploading.

Use Case Examples

  1. Compress a PDF file available at a public URL and get the compressed PDF as a downloadable URL.
  2. Compress a PDF file provided as binary data and receive the compressed PDF as binary output for further processing.

Properties

Name Meaning
Code Variables Variables defined in the code editor for the selected function, used to pass dynamic values during execution.
Get File as URL Whether to receive the compressed PDF as a URL.
Filename Filename of the PDF file.
URL or Binary Data Specifies if the input PDF is provided as a URL or as binary data (buffer).
URL Public URL of the PDF file (used if input type is URL).
Binary Data Buffer of the PDF file (used if input type is binary data).
Pages Pages inside the PDF file (optional, used when input is binary data).

Output

JSON

  • compressedPdfUrl - URL of the compressed PDF file if 'Get File as URL' is true.
  • compressedPdfBuffer - Binary data buffer of the compressed PDF if 'Get File as URL' is false.

Dependencies

  • An API key credential for the CodeKit API is required to authenticate requests.

Troubleshooting

  • Ensure the input PDF URL is publicly accessible if using URL input type.
  • Verify that the binary data buffer is correctly formatted if using binary input.
  • Check that the filename is provided if required by downstream processes.
  • If the node throws an error related to authentication, verify that the API key credential is correctly configured.

Discussion