Перейти к содержанию
НОВОЕМаркетплейс и trig8n Agent: продавайте то, что создали, и получайте планы и изменения, проверенные до того, как вы их увидите. Что нового

Библиотека / Документы, PDF и OCR

Документы, PDF и OCR

Преобразование Markdown в фирменный PDF с оглавлением с помощью PDFMint

Принимает Markdown, название и автора методом POST и возвращает фирменный PDF с необязательным оглавлением и водяным знаком через PDFMint. Запускается при каждом запросе.

Что делает

## Convert Markdown into a branded PDF with a table of contents Who it is for Anyone holding Markdown — an AI agent's answer, release notes, a knowledge-base page, a report written in an editor — who needs a finished, branded PDF back in the same request. No headless browser to run, no template editor to log into. How it works 1. Receive the Markdown document takes a POST with markdown, title and an optional author. 2. Set your document branding is the one node you edit: brand name, accent colour, page format, whether a table of contents is added, and an optional watermark such as DRAFT. 3. Check the request is usable turns an empty payload into a readable 422 before anything is rendered. 4. Check remaining quota asks PDFMint how many credits are left. The usage operation costs nothing. 5. Build the cover, contents and body does all the work in one place: it numbers every ## and ### heading, builds a contents list from exactly those numbers so the two cannot drift apart, skips headings inside fenced code blocks, counts the words, estimates the reading time, and assembles a cover block. It also derives the running header and the CSS from your accent colour. 6. Render the Markdown as PDF sends the assembled Markdown to PDFMint with your header, page numbers and styling. 7. Did the render succeed? decides which answer the caller gets, because the render node is set to continue on failure. 8. Return the PDF answers the POST with the file itself; Return the error as JSON answers with a status and a reason, so a caller never hangs. How to set it up - Install the verified community node n8n-nodes-pdfmint. It is available on n8n Cloud and self-hosted n8n; Cloud owners and admins can add it from More from the community in the nodes panel. - Create a PDFMint credential with your API key. - Open Set your document branding and put your own brand name, accent colour and page format in it. Nothing else needs editing. How to customise it - Swap Return the PDF for Gmail, Google Drive or S3 if you would rather deliver the file than answer with it. - Set draftWatermark to DRAFT while a document is unfinished; leave it empty for the final version. - Replace the webhook with a Schedule Trigger to turn a nightly report into a PDF. *Disclosure: I build PDFMint, and I wrote this template.*

Шаги

  1. Receive the Markdown document
  2. Set your document branding
  3. Check the request is usable
  4. Check remaining quota
  5. Is there quota left?
  6. Build the cover, contents and body
  7. Render the Markdown as PDF
  8. Did the render succeed?
  9. Return the PDF
  10. Explain what went wrong
  11. Return the error as JSON

Похожие автоматизации