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.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

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.

ParameterRequiredWhat it doesExample
Input Data TypeRequiredChoose how to provide the Markdown file to convert. Options: Binary Data, Base64 String, Markdown Code, URL. Default is `Binary Data`.Binary Data
Input Binary FieldConditionalName of the binary property that contains the Markdown file. Shown when Input Data Type is Binary Data. Default is `data`.data
Base64 Markdown ContentConditionalProvide the Markdown content already encoded in base64 format (not raw Markdown code). Example: IyBTYW1wbGUgTWFya2Rvd24KCkZvciBleGFtcGxlLCB0aGlzIGlzIGEgKipib2xkKiogdGV4dC4=. Shown when Input Data Type is Base64 String.IyBIZWxsbyBXb3JsZA==
Markdown CodeConditionalWrite your Markdown code here. It will be automatically converted to base64. Shown when Input Data Type is Markdown Code.
Markdown URLConditionalURL to the Markdown file to convert. Shown when Input Data Type is URL.https://abc.com/readme.md
Output File NameOptionalName for the output PDF file. Default is `markdown_to_pdf_output.pdf`.markdown_to_pdf_output.pdf
Document NameOptionalName of the source Markdown file with extension. Default is `sample.md`.sample.md
Output Binary Field NameOptionalName of the binary property to store the output PDF file. Default is `data`.data
Advanced OptionsOptionalOptional settings, collapsed behind Add Option.Add Option
Custom ProfilesOptionalUse "JSON" to adjust custom properties. Review Profiles at https://dev.pdf4me.com/apiv2/documentation/ to set extra options for API calls.{ "outputDataFormat": "base64" }

Output​

Output Parameters​

FieldTypeWhat it contains
fileNameStringFile name of the resulting file.
mimeTypeStringMIME type of the resulting file, for example `application/pdf`.
fileSizeNumberSize of the resulting file in bytes.
successBooleanTrue when the operation succeeded.
originalFileNameStringName of the input file.
messageStringStatus message from the node.
dataBinaryThe resulting PDF.

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​