0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

PDF → Convert PDF to Image

AI-generated

Overview

The node provides a utility to convert PDF files into images. It supports inputting a PDF either via a public URL or as binary buffer data, then processes the PDF to generate image files representing its pages. This is useful in scenarios where visual previews of PDFs are needed, such as generating thumbnails for documents, extracting page images for display in web apps, or converting reports and forms into image formats for easier sharing or embedding.

Practical examples:

  • Converting an online PDF report (via URL) into PNG images for embedding in dashboards.
  • Taking a PDF uploaded by a user (binary buffer) and generating JPEG previews for a document management system.
  • Automating conversion of invoices in PDF format into images for archival or OCR processing.

Properties

Name Meaning
PDF URL Public URL of the PDF file to convert
PDF Buffer Binary buffer data of the PDF file
File Name Name prefix for the output image files

Users can provide either a URL or a binary buffer as the source PDF. The "File Name" property sets the prefix used for naming the generated image files.

Output

The node outputs JSON data containing information about the converted images. Each output item corresponds to an image generated from a PDF page. The JSON typically includes metadata such as the image file name (using the provided prefix), format, and possibly URLs or binary data references to the images.

If the node supports binary data output, it would contain the image files in binary form attached to the output items, allowing downstream nodes to process or save them.

Dependencies

  • Requires an API key credential for authentication with the external service at https://prod.0codekit.com.
  • The node sends a POST request to the endpoint /pdf/pdf-to-image with the PDF data and filename parameters.
  • No other explicit dependencies are indicated in the static code.

Troubleshooting

  • Common issues:
    • Providing both URL and buffer empty or invalid will cause failure; ensure one valid PDF source is given.
    • Network errors when accessing the PDF URL or calling the external API.
    • Incorrect or missing API key credential will result in authentication errors.
  • Error messages:
    • Authentication failures indicate missing or invalid API credentials.
    • Invalid PDF input errors occur if the PDF URL is unreachable or the buffer is corrupted.
    • API response errors may indicate service-side issues or rate limits.

To resolve these, verify the PDF source, check network connectivity, and confirm the API key configuration in n8n credentials.

Links and References

  • 0CodeKit API Documentation (assumed base URL for API)
  • General info on PDF to Image conversion tools and libraries (e.g., ImageMagick, Poppler) for context on typical use cases.

Discussion