0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

PDF → Convert Markdown to PDF

AI-generated

Overview

This node provides a utility to convert Markdown content into a PDF document. It is useful in scenarios where users want to generate styled PDF reports, documentation, or printable content directly from Markdown text within an n8n workflow. For example, you can create a PDF invoice, a formatted report, or export notes written in Markdown as a PDF file.

The node supports adding custom CSS styles to control the appearance of the resulting PDF and offers flexibility in how the output is returned—either as a downloadable URL or as binary data.

Properties

Name Meaning
Markdown Content The Markdown text content that will be converted into a PDF document.
Custom CSS Optional CSS styles to customize the look and feel of the rendered Markdown in the PDF.
Return as URL Boolean option to specify whether the PDF should be returned as a downloadable URL (true) or as binary data (false).
File Name The desired name for the output PDF file (used when returning as a URL or saving the file).

Output

  • The node outputs a JSON object containing either:

    • A URL pointing to the generated PDF file if "Return as URL" is set to true.
    • Or binary data representing the PDF file if "Return as URL" is false.
  • If binary data is returned, it can be used downstream in the workflow to save the file, send it via email, or upload it to storage.

Dependencies

  • Requires an API key credential for authentication with the external 0CodeKit service.
  • The node sends a POST request to the /pdf/markdownstringtopdf endpoint of the 0CodeKit API.
  • No additional environment variables are needed beyond the API key credential configuration.

Troubleshooting

  • Common issues:

    • Invalid or missing Markdown content will cause the conversion to fail.
    • Incorrect or malformed CSS might not apply styling correctly but usually won't break the PDF generation.
    • Network or authentication errors if the API key is invalid or missing.
  • Error messages:

    • Authentication errors typically indicate problems with the API key; verify the credential setup.
    • API response errors may include details about invalid input; ensure Markdown content is properly formatted.
    • Timeout or network errors suggest connectivity issues; retry or check network settings.

Links and References

Discussion