PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

This node operation converts Markdown content into a PDF document. It supports multiple input methods for the Markdown source, including binary data from a previous node, base64-encoded strings, raw Markdown code entered manually, or a URL pointing to a Markdown file. The node processes the Markdown and outputs a PDF file as binary data.

This operation is useful in scenarios where users want to automate the generation of PDF documents from Markdown content within an n8n workflow. For example:

  • Automatically converting README files hosted online into PDFs.
  • Generating reports or documentation from Markdown text created dynamically in workflows.
  • Converting user-submitted Markdown content into downloadable PDF files.

Properties

Name Meaning
Input Data Type Method to provide the Markdown content:
- Binary Data: Use a binary file from a previous node.
- Base64 String: Provide Markdown content already encoded in base64.
- Markdown Code: Write raw Markdown code manually.
- URL: Provide a URL to a Markdown file.
Input Binary Field (When Input Data Type is Binary Data) The name of the binary property containing the Markdown file.
Base64 Markdown Content (When Input Data Type is Base64 String) The Markdown content already encoded in base64 format.
Markdown Code (When Input Data Type is Markdown Code) Raw Markdown text entered manually; it will be converted automatically to base64.
Markdown URL (When Input Data Type is URL) URL pointing to the Markdown file to convert.
Output File Name The desired filename for the output PDF file (e.g., "my-markdown-converted.pdf"). Defaults to "markdown_to_pdf_output.pdf".
Document Name The name of the source Markdown file with extension (e.g., "original-file.md"). This is used internally to identify the source document.
Output Binary Field Name The name of the binary property where the resulting PDF file will be stored. Defaults to "data".
Advanced Options Custom JSON profiles to adjust additional properties for the conversion API call. Users can specify extra options according to the external service's documentation.

Output

The node outputs the converted PDF file as binary data under the specified binary property name (default "data"). The json output contains metadata about the operation and the binary data reference. The binary data represents the generated PDF document that can be saved, sent, or further processed in subsequent workflow steps.

Dependencies

  • Requires access to an external PDF conversion API service capable of converting Markdown to PDF.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests to this service.
  • Network access to fetch Markdown files if using the URL input method.

Troubleshooting

  • Common Issues:

    • Providing an invalid or inaccessible URL for the Markdown file will cause the conversion to fail.
    • Incorrectly formatted base64 content or raw Markdown syntax errors may result in unexpected PDF output or errors.
    • Missing or misnamed binary property fields when using binary input type can cause the node to not find the Markdown file.
    • API authentication failures due to missing or incorrect credentials.
  • Error Messages:

    • Errors related to fetching the Markdown file from URL usually indicate network issues or invalid URLs.
    • Conversion errors might mention invalid input data or unsupported Markdown features.
    • Authentication errors suggest checking the configured API key or token.
  • Resolutions:

    • Verify URLs are correct and accessible.
    • Ensure base64 content is properly encoded.
    • Confirm binary property names match those provided by previous nodes.
    • Check and update API credentials in n8n settings.

Links and References

Discussion