Skip to main content

Convert Markdown to PDF using n8n action

PDF4me Convert Markdown to PDF transforms Markdown content into high-quality PDF documents through n8n automation workflows. Process Markdown files via n8n triggers, binary data, base64 strings, or public URLs to generate PDFs with preserved formatting including headers, lists, code blocks, tables, images, links, embedded HTML, syntax highlighting, and professional typography. This solution is ideal for technical documentation, README files, API documentation, content management systems, GitHub integration, knowledge base exports, and automated document workflows that require accurate Markdown rendering with professional PDF output and seamless integration.

Setup

Add the PDF4me "Convert Markdown to PDF" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Convert Markdown to PDF" action
  3. Configure input parameters (see below)
Convert Markdown to PDF

Parameters

Complete list of parameters for the Convert Markdown to PDF action. Configure these parameters to control Markdown to PDF conversion.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
Input Data Type***StringMarkdown Input Format Selection
� Choose the format of your Markdown data input
� PDF4me supports multiple input types
� Options: Binary Data, Base64 String, or URL
Binary Data
Input Binary FieldBinaryBinary Markdown File Input (Required if Binary Data)
� Reference Markdown file from previous n8n node or file upload
� PDF4me processes binary Markdown files with automatic format detection
� Required when Input Data Type is "Binary Data"
{{ $binary.data }}
Base64 Markdown ContentStringBase64 Encoded Markdown Input (Required if Base64 String)
� Provide Markdown content as base64 encoded string
� PDF4me automatically decodes and processes the Markdown content
� Required when Input Data Type is "Base64 String"
IyBIZWxsbyBXb3JsZA==
Markdown URLStringPublic Markdown URL Input (Required if URL)
� Provide a public/open permission URL to the Markdown file
� PDF4me downloads and processes the file from URL
� Required when Input Data Type is "URL"
https://abc.com/readme.md
Document Name***StringMarkdown Input Filename
� Specify the name of the input Markdown file
� Must include proper extension (.md, .markdown)
� PDF4me uses this for format detection and processing
sample.md
Output File Name***StringPDF Output Filename
� Specify the name for the generated PDF file
� Must include .pdf extension
� PDF4me ensures unique naming and format validation
markdown_to_pdf_output.pdf
Output Binary Field Name***StringBinary Data Output Mapping
� Define the variable name for accessing generated PDF binary data
� Used in subsequent workflow actions
� Essential for workflow automation
data

Advanced Options

The following parameters are available in the Advanced Options section and are optional:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom Configuration Profiles
� Set additional options using custom profiles
� JSON-like format containing predefined parameters
� Enables advanced PDF generation settings
� Optional for specialized requirements
{ "outputDataFormat": "base64" }

Output

Output Parameters

ParameterTypeDescriptionExample
fileNameStringPDF4me generated PDF filename - The complete filename of the successfully generated PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processesmarkdown_to_pdf_output.pdf
mimeTypeStringPDF4me MIME type identifier - The standardized MIME type for the generated PDF file, always set to application/pdf by PDF4me's conversion engine. This ensures proper file handling and recognition across all systems and applicationsapplication/pdf
fileSizeNumberPDF4me PDF file size in bytes - The exact size of the generated PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation76256
successBooleanPDF4me conversion status indicator - Boolean flag indicating the success or failure of the Markdown-to-PDF conversion process. PDF4me returns true for successful conversions and false for any errors, enabling robust error handling in automated workflowstrue
messageStringPDF4me conversion status message - Descriptive message indicating the result of the Markdown-to-PDF conversion process. PDF4me provides clear status messages for successful conversions and detailed error information for troubleshooting purposesMarkdown converted to PDF successfully
originalFileNameStringPDF4me original filename reference - The original filename of the input Markdown file that was processed by PDF4me's conversion engine. This reference is maintained for audit trails, debugging purposes, and tracking the source of generated PDF documents in enterprise workflowsmarkdown_file

N8N Action Response

The PDF4me Convert Markdown to PDF API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

{
"fileName": "markdown_to_pdf_output.pdf",
"mimeType": "application/pdf",
"fileSize": 76256,
"success": true,
"originalFileName": "markdown_file",
"message": "Markdown converted to PDF successfully"
}

Use Cases

Technical Documentation and Developer Resources

  • Convert README files, API documentation, and technical guides from Markdown format to PDF for offline access, printing, and distribution to development teams and stakeholders
  • Process GitHub documentation, project wikis, and code documentation by converting Markdown content to PDF format for formal documentation and compliance requirements
  • Generate PDF versions of technical specifications, design documents, and architecture guides from Markdown source files for client presentations and project deliverables

Content Management and Publishing

  • Convert blog posts, articles, and online content from Markdown format to PDF for print publishing, ebook creation, and offline content distribution
  • Process documentation websites and knowledge bases by converting Markdown content to PDF format for archiving, backup, and offline reference purposes
  • Generate PDF versions of newsletters, reports, and publications from Markdown source files for professional distribution and formal documentation

Academic and Educational Content

  • Convert research papers, thesis documents, and academic content from Markdown format to PDF for submission to journals, conferences, and academic institutions
  • Process course materials, lecture notes, and educational content by converting Markdown files to PDF format for student distribution and offline learning
  • Generate PDF versions of study guides, textbooks, and educational resources from Markdown source files for formal publication and educational distribution

Get Help