{"product_id":"n8n-workflow-markdown-to-branded-pdf-with-toc-pdfmint","title":"n8n Workflow: Markdown to Branded PDF with TOC (PDFMint)","description":"\u003ch3\u003eTurn Markdown into a branded, numbered PDF—with a working table of contents (TOC)\u003c\/h3\u003e\n\u003cp\u003eSend Markdown to this n8n workflow and instantly get back a finished, brand-styled PDF in the same HTTP request—complete with numbered \u003cstrong\u003eheadings\u003c\/strong\u003e, a \u003cstrong\u003eTOC built from those exact numbers\u003c\/strong\u003e, a cover block (word count + reading time), and your accent color styling via \u003cstrong\u003ePDFMint\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReceives a POST\u003c\/strong\u003e via a webhook containing \u003ccode\u003emarkdown\u003c\/code\u003e, \u003ccode\u003etitle\u003c\/code\u003e, and an optional \u003ccode\u003eauthor\u003c\/code\u003e—perfect for automation and AI outputs.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConfigures all settings in one place\u003c\/strong\u003e (using a single Set node), including your brand name, accent colour, page format, whether a table of contents is added, and an optional watermark (e.g., \u003ccode\u003eDRAFT\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePrevents broken renders\u003c\/strong\u003e: if the payload is empty, the workflow returns a readable \u003cstrong\u003e422\u003c\/strong\u003e response instead of generating a one-line PDF.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks PDFMint usage\u003c\/strong\u003e with a credit-free \u003ccode\u003eusage\u003c\/code\u003e operation, and returns a clear explanation if you’ve run out—so rendering doesn’t fail mid-run.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTransforms content in a Code node\u003c\/strong\u003e: numbers every \u003ccode\u003e##\u003c\/code\u003e and \u003ccode\u003e###\u003c\/code\u003e heading, builds the TOC from those exact numbers (so they cannot drift), ignores headings inside fenced code blocks, counts words, estimates reading time, and assembles the cover. It also derives the running header and stylesheet from your accent colour.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRenders the final PDF\u003c\/strong\u003e with PDFMint using the assembled, branded Markdown (including header and page numbers).\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eGenerate branded release notes or changelogs from an AI agent’s Markdown.\u003c\/li\u003e\n  \u003cli\u003ePublish knowledge-base pages as consistent PDF handouts with TOC and numbering.\u003c\/li\u003e\n  \u003cli\u003eCreate internal reports from editor-written Markdown—optionally watermarked as \u003cem\u003eDRAFT\u003c\/em\u003e.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWebhook\u003c\/strong\u003e (POST input\/output in the same HTTP request)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSet\u003c\/strong\u003e (brand, accent color, format, TOC toggle, watermark)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCode\u003c\/strong\u003e (heading numbering, TOC generation, cover creation, word count, reading time, styling)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eif\u003c\/strong\u003e (empty payload handling and usage\/routing)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePDFMint\u003c\/strong\u003e via \u003ccode\u003en8n-nodes-pdfmintpdf\u003c\/code\u003e (credit-free \u003ccode\u003eusage\u003c\/code\u003e + PDF rendering)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSticky Note\u003c\/strong\u003e (workflow documentation)\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45967470100659,"sku":"N8N-19277","price":67.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/NyJjZfqH5EjA5SFLYgC8_exjSRBJZ.png?v=1788685401","url":"https:\/\/buyflowscripts.com\/products\/n8n-workflow-markdown-to-branded-pdf-with-toc-pdfmint","provider":"N8N Commerce","version":"1.0","type":"link"}