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:
- Add PDF4me node to workflow
- Select "Convert Markdown to PDF" action
- Configure input parameters (see below)

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.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| Input Data Type | Required | Choose how to provide the Markdown file to convert. Options: Binary Data, Base64 String, Markdown Code, URL. Default is `Binary Data`. | Binary Data |
| Input Binary Field | Conditional | Name of the binary property that contains the Markdown file. Shown when Input Data Type is Binary Data. Default is `data`. | data |
| Base64 Markdown Content | Conditional | Provide the Markdown content already encoded in base64 format (not raw Markdown code). Example: IyBTYW1wbGUgTWFya2Rvd24KCkZvciBleGFtcGxlLCB0aGlzIGlzIGEgKipib2xkKiogdGV4dC4=. Shown when Input Data Type is Base64 String. | IyBIZWxsbyBXb3JsZA== |
| Markdown Code | Conditional | Write your Markdown code here. It will be automatically converted to base64. Shown when Input Data Type is Markdown Code. | |
| Markdown URL | Conditional | URL to the Markdown file to convert. Shown when Input Data Type is URL. | https://abc.com/readme.md |
| Output File Name | Optional | Name for the output PDF file. Default is `markdown_to_pdf_output.pdf`. | markdown_to_pdf_output.pdf |
| Document Name | Optional | Name of the source Markdown file with extension. Default is `sample.md`. | sample.md |
| Output Binary Field Name | Optional | Name of the binary property to store the output PDF file. Default is `data`. | data |
| Advanced Options | Optional | Optional settings, collapsed behind Add Option. | Add Option |
| Custom Profiles | Optional | Use "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
| Field | Type | What it contains |
|---|---|---|
fileName | String | File name of the resulting file. |
mimeType | String | MIME type of the resulting file, for example `application/pdf`. |
fileSize | Number | Size of the resulting file in bytes. |
success | Boolean | True when the operation succeeded. |
originalFileName | String | Name of the input file. |
message | String | Status message from the node. |
data | Binary | The 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
- Table
- Schema
- Binary
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"
}
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | markdown_to_pdf_output.pdf |
| mimeType | application/pdf |
| fileSize | 76256 |
| success | true |
| originalFileName | markdown_file |
| message | Markdown converted to PDF successfully |
Schema View
The data structure and types of the response:
fileName: AB markdown_to_pdf_output.pdf
mimeType: AB application/pdf
fileSize: # 76256
success: ☑ true
originalFileName: AB markdown_file
message: AB Markdown converted to PDF successfully
Type Indicators:
AB= String#= Number☑= Boolean
Binary Data View
The actual PDF file data and metadata:
data
─────────────────────────────
File Name: markdown_to_pdf_output.pdf
File Extension: pdf
Mime Type: application/pdf
File Size: 1.35 MB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
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