{
    "type": "project",
    "title": "PrintMD",
    "canonical": "https://www.dealmobile.co.uk/projects/printmd",
    "path": "/projects/printmd",
    "url": "https://www.dealmobile.co.uk/projects/printmd",
    "markdown": "https://www.dealmobile.co.uk/projects/printmd.md",
    "json": "https://www.dealmobile.co.uk/projects/printmd.json",
    "summary": "Write Markdown, see the page as you type and export a PDF, a Word file or a PowerPoint file from the same text. A local PDF service and a Claude Code skill turn a Markdown file into a PDF with one command.",
    "published": "2026-11-02T11:22:31+00:00",
    "modified": "2026-11-02T11:22:31+00:00",
    "image": {
        "url": "https://www.dealmobile.co.uk/sites/default/files/content/images/products/printmd.png",
        "alt": "The PrintMD editor with a short document called Paper sizes, briefly: the Markdown on the left, with its front matter and a table of A sizes, and on the right the cover page in the Dealmobile template, its title in heavy black type with the last word in red italic."
    },
    "fields": {
        "featured": true,
        "kind": "tool",
        "licence": "MIT",
        "links": [
            {
                "title": "Open the editor",
                "url": "https://printmd.dealmobile.co.uk"
            },
            {
                "title": "Source on GitHub",
                "url": "https://github.com/tomgould/PrintMD"
            }
        ],
        "stack": [
            "JavaScript",
            "HTML",
            "CSS",
            "Node.js",
            "Playwright",
            "REST APIs",
            "Claude Code"
        ],
        "started": 2026,
        "status": "live",
        "tagline": "A Markdown editor that exports print-quality PDF, Word and PowerPoint files, with a small PDF service that runs on your own computer."
    },
    "body": {
        "html": "<p>PrintMD is for anyone who writes in Markdown and then has to hand someone a document. I wanted PDFs from my own notes that looked as if someone had designed them, without opening a word processor. You write on the left, the page in the chosen template is on the right, and Export gives you a PDF, a Word file or a PowerPoint file from the same text.</p>\n<p>The editor is plain HTML, CSS and JavaScript modules: no build step, no framework and nothing to install. Serve the folder and it runs.</p>\n<h2 id=\"what-it-does\">What it does</h2>\n<ul>\n<li>A live preview in the template’s own type and spacing, split or single pane, in a light or dark theme.</li>\n<li>Export to PDF, Word (<code>.docx</code>) and PowerPoint (<code>.pptx</code>).</li>\n<li>Import from PDF, Word, HTML, EPUB and Google Drive, converted to Markdown. A publicly shared Google Doc imports from its link without signing in, and a shared Sheet brings its first tab as a table. For private files, each visitor signs in with their own Google account and supplies a Google Cloud client ID of their own, plus an API key for the Drive picker.</li>\n<li>Page options for each document: A4, A3, A5, Letter or Legal, or a custom size, one continuous page as tall as the content, wide tables scaled to fit, and your own margin.</li>\n<li>Front matter at the top of a document sets the cover’s title, author and date, and its layout, fit and margin. The PDF service reads its page size too.</li>\n<li>Code blocks coloured in more than 190 languages, footnotes, definition lists, and <code>==highlight==</code>, <code>~sub~</code> and <code>^sup^</code>.</li>\n<li>Documents are kept in the browser. In Chrome and Edge, a file you open from disk stays linked to it, so saving writes back to the file.</li>\n</ul>\n<p>There are two templates. Unbranded is a quiet, classic document and the default. Dealmobile is a magazine article: heavy grotesque headlines over a Caslon text face, one red accent and a running head and foot.</p>\n<h2 id=\"the-pdf-service\">The PDF service</h2>\n<p>The repository also holds a small HTTP service. Send it Markdown and it sends back a PDF, printed by a browser on your own machine: the Chromium that Playwright downloads, or your own Chrome if you point it there:</p>\n<pre><code class=\"language-bash\">curl -s -X POST 'http://127.0.0.1:8787/api/v1/render?template=dealmobile' \\\n  -H 'Content-Type: text/markdown' --data-binary @notes.md -o notes.pdf\n</code></pre>\n<p>Response headers report the page count and anything the render found, such as an image too small to print well. The service only runs on your own computer: it refuses to start on any address that isn’t loopback, or with a token or a login in front of it. That is on purpose, and <a href=\"/writing/a-pdf-service-that-only-runs-on-your-machine\">a post of its own</a> explains why.</p>\n<p>A Claude Code skill ships in the repository, in <code>skills/printmd</code>. With it installed, “make a PDF of notes.md in the Dealmobile template” is enough. Claude checks the service is running, lists the templates, embeds the document’s local images, writes the PDF next to the Markdown and reports its path and page count. It needs Claude Code on your own machine, because that is where the service is.</p>\n<h2 id=\"how-its-built\">How it’s built</h2>\n<p>Markdown is parsed with marked and cleaned with DOMPurify. The Word and PowerPoint files are built in the browser with JSZip and PptxGenJS, and the importers use pdf.js, Mammoth and Turndown. The libraries and fonts live in the repository’s <code>vendor</code> folder, and the page’s content security policy only loads fonts from the app itself.</p>\n<p>Most of the work went into making the PDFs right rather than nearly right: embedded fonts, the exact page size, no heading left at the foot of a page, and tables that repeat their header row. <a href=\"/writing/print-quality-pdfs-from-a-browser\">Print-quality PDFs from a browser</a> covers those rules, and <a href=\"/writing/page-options-custom-size-continuous-fit\">custom sizes, one long page and fit to width</a> covers the page options. The tests print sample documents and check the PDFs with the poppler tools.</p>\n<h2 id=\"how-to-use-it\">How to use it</h2>\n<p>The <a href=\"https://printmd.dealmobile.co.uk\">hosted editor</a> is there for a look around. The editor makes its PDFs through the browser’s print dialog, hosted or not; the PDF service is the other route, and it only runs locally. To get everything, run it on your own machine:</p>\n<pre><code class=\"language-bash\">git clone https://github.com/tomgould/PrintMD.git printmd\ncd printmd\npython3 -m http.server 8080\n</code></pre>\n<p>Then open <code>http://localhost:8080</code> in a recent Chrome or Edge. The PDF service needs Node 22:</p>\n<pre><code class=\"language-bash\">npm --prefix server ci\nnpx --prefix server playwright install chromium\nnpm --prefix server run start:local\n</code></pre>\n<p>It listens on <code>http://127.0.0.1:8787</code>. On Linux, <code>server/service/install-service.sh</code> installs it as a user service that starts at login.</p>"
    },
    "markdown_text": "---\ntitle: PrintMD\ncanonical: 'https://www.dealmobile.co.uk/projects/printmd'\nurl: 'https://www.dealmobile.co.uk/projects/printmd'\ntype: Project\nsummary: 'Write Markdown, see the page as you type and export a PDF, a Word file or a PowerPoint file from the same text. A local PDF service and a Claude Code skill turn a Markdown file into a PDF with one command.'\n---\n\n# PrintMD\n\nA Markdown editor that exports print-quality PDF, Word and PowerPoint files, with a small PDF service that runs on your own computer.\n\n![The PrintMD editor with a short document called Paper sizes, briefly: the Markdown on the left, with its front matter and a table of A sizes, and on the right the cover page in the Dealmobile template, its title in heavy black type with the last word in red italic.](https://www.dealmobile.co.uk/sites/default/files/styles/almanac_shot_md/public/content/images/products/printmd.png.webp?itok=TD1n14rH)\n\n- **Kind:** Tool\n- **Status:** Live\n- **Started:** 2026\n- **Licence:** MIT\n- **Stack:** JavaScript, HTML, CSS, Node.js, Playwright, REST APIs, Claude Code\n- **Links:** [Open the editor](https://printmd.dealmobile.co.uk), [Source on GitHub](https://github.com/tomgould/PrintMD)\n\nPrintMD is for anyone who writes in Markdown and then has to hand someone a document. I wanted PDFs from my own notes that looked as if someone had designed them, without opening a word processor. You write on the left, the page in the chosen template is on the right, and Export gives you a PDF, a Word file or a PowerPoint file from the same text.\n\nThe editor is plain HTML, CSS and JavaScript modules: no build step, no framework and nothing to install. Serve the folder and it runs.\n\n## What it does\n\n- A live preview in the template’s own type and spacing, split or single pane, in a light or dark theme.\n- Export to PDF, Word (`.docx`) and PowerPoint (`.pptx`).\n- Import from PDF, Word, HTML, EPUB and Google Drive, converted to Markdown. A publicly shared Google Doc imports from its link without signing in, and a shared Sheet brings its first tab as a table. For private files, each visitor signs in with their own Google account and supplies a Google Cloud client ID of their own, plus an API key for the Drive picker.\n- Page options for each document: A4, A3, A5, Letter or Legal, or a custom size, one continuous page as tall as the content, wide tables scaled to fit, and your own margin.\n- Front matter at the top of a document sets the cover’s title, author and date, and its layout, fit and margin. The PDF service reads its page size too.\n- Code blocks coloured in more than 190 languages, footnotes, definition lists, and `==highlight==`, `~sub~` and `^sup^`.\n- Documents are kept in the browser. In Chrome and Edge, a file you open from disk stays linked to it, so saving writes back to the file.\n\nThere are two templates. Unbranded is a quiet, classic document and the default. Dealmobile is a magazine article: heavy grotesque headlines over a Caslon text face, one red accent and a running head and foot.\n\n## The PDF service\n\nThe repository also holds a small HTTP service. Send it Markdown and it sends back a PDF, printed by a browser on your own machine: the Chromium that Playwright downloads, or your own Chrome if you point it there:\n\n```bash\ncurl -s -X POST 'http://127.0.0.1:8787/api/v1/render?template=dealmobile' \\\n  -H 'Content-Type: text/markdown' --data-binary @notes.md -o notes.pdf\n\n```\n\nResponse headers report the page count and anything the render found, such as an image too small to print well. The service only runs on your own computer: it refuses to start on any address that isn’t loopback, or with a token or a login in front of it. That is on purpose, and [a post of its own](https://www.dealmobile.co.uk/writing/a-pdf-service-that-only-runs-on-your-machine.md) explains why.\n\nA Claude Code skill ships in the repository, in `skills/printmd`. With it installed, “make a PDF of notes.md in the Dealmobile template” is enough. Claude checks the service is running, lists the templates, embeds the document’s local images, writes the PDF next to the Markdown and reports its path and page count. It needs Claude Code on your own machine, because that is where the service is.\n\n## How it’s built\n\nMarkdown is parsed with marked and cleaned with DOMPurify. The Word and PowerPoint files are built in the browser with JSZip and PptxGenJS, and the importers use pdf.js, Mammoth and Turndown. The libraries and fonts live in the repository’s `vendor` folder, and the page’s content security policy only loads fonts from the app itself.\n\nMost of the work went into making the PDFs right rather than nearly right: embedded fonts, the exact page size, no heading left at the foot of a page, and tables that repeat their header row. [Print-quality PDFs from a browser](https://www.dealmobile.co.uk/writing/print-quality-pdfs-from-a-browser.md) covers those rules, and [custom sizes, one long page and fit to width](https://www.dealmobile.co.uk/writing/page-options-custom-size-continuous-fit.md) covers the page options. The tests print sample documents and check the PDFs with the poppler tools.\n\n## How to use it\n\nThe [hosted editor](https://printmd.dealmobile.co.uk) is there for a look around. The editor makes its PDFs through the browser’s print dialog, hosted or not; the PDF service is the other route, and it only runs locally. To get everything, run it on your own machine:\n\n```bash\ngit clone https://github.com/tomgould/PrintMD.git printmd\ncd printmd\npython3 -m http.server 8080\n\n```\n\nThen open `http://localhost:8080` in a recent Chrome or Edge. The PDF service needs Node 22:\n\n```bash\nnpm --prefix server ci\nnpx --prefix server playwright install chromium\nnpm --prefix server run start:local\n\n```\n\nIt listens on `http://127.0.0.1:8787`. On Linux, `server/service/install-service.sh` installs it as a user service that starts at login.\n\n---\n\nIndex of this site: [llms.txt](https://www.dealmobile.co.uk/llms.txt)\n"
}