0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

PDF → Add PDF Pages

AI-generated

Overview

The node provides utilities to manipulate PDF files, specifically allowing users to add blank pages to an existing PDF document. This operation is useful when you need to insert additional space or placeholders into a PDF without altering the original content. Common scenarios include preparing forms, adding cover pages, or extending documents for annotations.

For example, you might have a PDF report and want to add two blank pages at the beginning for notes, or append a few blank pages at the end for signatures.

Properties

Name Meaning
PDF URL Public URL of the PDF file to which pages will be added.
PDF Buffer Binary buffer data of the PDF file as input instead of a URL.
Number of Pages Number of blank pages to add to the PDF (required).
Insert Position Where to insert the new pages: Beginning, End, After Page, or Before Page.
Page Number The page number after or before which to insert pages (only applicable if position is After Page or Before Page).
Page Size Size of the pages to add. Options: A3, A4, A5, Legal, Letter, Tabloid.
File Name Name for the output PDF file with the added pages.
Return as URL Whether to return the resulting PDF as a downloadable URL (true/false).

Output

The node outputs a JSON object representing the modified PDF file. Depending on the "Return as URL" property, the output will either contain:

  • A downloadable URL pointing to the newly created PDF with the added pages.
  • Or the binary data of the updated PDF file directly in the output.

This allows subsequent nodes to either download the file from the URL or process the binary data further.

Dependencies

  • Requires an API key credential for authentication with the external 0CodeKit service.
  • The node sends a POST request to the endpoint /pdf/pages/add on the 0CodeKit API server.
  • The API expects either a public URL or binary buffer of the source PDF.
  • No local PDF processing; all operations are performed remotely via the API.

Troubleshooting

  • Invalid PDF Input: If neither a valid URL nor a binary buffer is provided, the API call will fail. Ensure one of these inputs is correctly set.
  • Page Number Errors: When inserting pages "After Page" or "Before Page," specifying a page number outside the range of the original PDF may cause errors.
  • API Authentication Failures: Missing or invalid API credentials will prevent the node from executing successfully.
  • File Name Issues: Providing an invalid or empty file name might result in default naming or errors in the output.
  • Network Issues: Since the operation depends on an external API, network connectivity problems can cause timeouts or failures.

To resolve these issues:

  • Verify input properties carefully.
  • Check API key validity and permissions.
  • Confirm network access to the API endpoint.
  • Use valid page numbers within the bounds of the original PDF.

Links and References

Discussion