Convertisseur Markdown → PDF, gratuit
Convertissez du Markdown en PDF avec aperçu en direct. Personnalisez la taille de page et les marges. Tourne entièrement dans votre navigateur.
À propos du Markdown
Le Markdown est un langage de balisage léger qui convertit du texte brut en HTML formaté. Il est largement utilisé pour la documentation, les blogs et l'écriture technique car il est facile à lire et à écrire.
Syntaxe Markdown
- #, ##, ### · titres (h1, h2, h3)
- **texte** · texte en gras
- *texte* · texte en italique
- [lien](url) · hyperliens
- - élément · listes non ordonnées
- 1. élément · listes ordonnées
Questions fréquentes
Puis-je utiliser du HTML dans Markdown ?
Oui. Markdown prend en charge le HTML en ligne, vous pouvez donc incorporer directement des balises HTML dans votre Markdown.
Quelles tailles de page sont prises en charge ?
A4, Letter, A3 et A5 sont prises en charge. Les marges sont réglables entre 0 et 50 millimètres.
La génération de PDF est-elle côté client ?
Oui. Toute la conversion se fait dans votre navigateur. Votre Markdown n'est jamais envoyé à nos serveurs.
How this converter works
A browser-based Markdown-to-PDF tool runs a two-stage pipeline. First, the Markdown source is parsed into HTML by a JavaScript Markdown parser (this page uses marked.js, a small, fast, MIT-licensed parser maintained by the MarkedJS organisation). The result is the HTML you see in the live preview. Second, that HTML is converted to a PDF, this page uses html2pdf.js, which itself wraps two libraries: html2canvas repaints the rendered DOM onto an off-screen canvas by reading the computed styles, and jsPDF writes that canvas image into a PDF page object and saves the file.
The libraries themselves are loaded from a public CDN, but your Markdown is parsed and the PDF is generated entirely on your device. The browser is the renderer; nothing leaves the page.
A short history of PDF
PDF began as Adobe co-founder John Warnock's internal proposal in 1991. He wanted a way to share documents that looked the same on every screen, every printer, every operating system. The short paper that started it was titled "The Camelot Project," and Adobe published the first PDF specification on 15 June 1993 alongside Adobe Acrobat 1.0. Adobe stewarded the format for fifteen years before publishing PDF 1.7 to ISO. ISO 32000-1:2008 made PDF an open standard freely usable without licensing, the single most important date for understanding why every modern tool, browser, and OS can write PDFs today. ISO 32000-2:2017 (PDF 2.0) added improved digital signatures, better Unicode handling, and formal accessibility hooks. The 2020 corrected edition was made freely downloadable by the PDF Association in April 2023, removing the last cost barrier.
A PDF is essentially a structured container of objects arranged for random access, vector graphics (lines and Bézier curves), raster images (typically JPEG or zlib-compressed), embedded fonts (Type 1, TrueType, OpenType), and a cross-reference table that lets readers jump anywhere without parsing the whole file. There are several PDF subset standards worth knowing about: PDF/A (archival, ISO 19005, 2005, prohibits anything that could break long-term readability), PDF/X (print production with locked-down colour management), and PDF/UA (Universal Accessibility, ISO 14289-1, 2012, requires fully tagged PDFs with reading order, alt text, embedded fonts mapped to Unicode, and document language declared).
Page sizes
The A series comes from ISO 216 (formalised 1975, traceable to Germany's DIN 476 from 1922). Every A-size has the same √2 (≈ 1.414) aspect ratio, which means halving the long edge of A3 produces two A4s with no waste, and halving A4 produces two A5s. A0 is exactly 1 m². The North American sizes (Letter, Legal, Tabloid) ignore √2 and trace to colonial paper-making conventions:
- A4: 210 × 297 mm (8.3 × 11.7 in). Global default outside North America.
- A3: 297 × 420 mm (11.7 × 16.5 in). Posters, spreads.
- A5: 148 × 210 mm (5.8 × 8.3 in). Booklets, zines.
- Letter: 8.5 × 11 in (215.9 × 279.4 mm). Default in the US, Canada, and the Philippines.
The default 10 mm margin is tighter than Microsoft Word's default of 1 inch (25.4 mm) but works well for code-heavy or table-dense documents where you want every column to fit.
The honest caveat: text isn't selectable
Because the converter renders the HTML to a canvas and embeds the canvas as an image inside the PDF, the resulting text is not selectable, not searchable, and not screen-reader accessible. It's a faithful picture of what the browser would draw, but it's a picture. This is fine for visual artefacts like recipe cards, mood boards, or printed handouts; it's a poor fit for legal documents, resumes a recruiter wants to keyword-scan, or anything that needs to pass an accessibility audit (WCAG / Section 508 / EN 301 549).
If you need selectable text or a tagged PDF, the right tools are Pandoc (combined with LaTeX or wkhtmltopdf or weasyprint) or Adobe Acrobat Pro with its tagging tools. Pandoc is the gold standard for serious document production, installable via Homebrew or Chocolatey, runs from the command line, gives full LaTeX-grade typography control with footnotes, bibliographies, citations, smart quotes, and proper ligatures.
Forcing page breaks
html2pdf.js honours CSS print-fragmentation properties. Because Markdown lets you embed inline HTML, you can force a page break by pasting:
<div style="break-before: page;"></div>
The legacy alias page-break-before: always works too. Other useful properties: break-inside: avoid on a table or code block prevents it from being split across pages; orphans and widows control how many lines must stay together at the bottom or top of a page.
Tips for clean output
- Avoid huge raster images. A single full-page photo can add hundreds of kilobytes. Resize images before embedding, or use
max-widthin inline styles to limit how big they render. - Tables that won't break across pages: wrap them with
<div style="break-inside: avoid">. - Code blocks need monospace. The browser uses your OS's monospace font when nothing more specific is set, Consolas on Windows, Menlo on macOS, DejaVu Mono on Linux. The output will look slightly different on each.
- Test with realistic content length. A short test document is fine but the layout sometimes looks different at 10+ pages.
- Letter vs A4. If you're sharing with US recipients, choose Letter; the rest of the world expects A4. Mismatched sizes don't break anything but cause minor margins / scaling oddities at the printer.
Common Markdown for this kind of output
The supported syntax is the GitHub-flavoured subset, headings, bold and italic, lists, tables, code blocks with simple syntax highlighting, blockquotes, links and images. Footnotes and Mermaid diagrams are not supported by this build. Quick reminder of the basics:
- Headings:
# H1through###### H6. - Bold and italic:
**bold**,*italic*,***both***. - Lists:
- itemfor unordered,1. itemfor ordered. - Links and images:
[text](url)and. Always include alt text. - Tables: pipe-delimited rows with a hyphen separator row.
- Fenced code blocks: three backticks plus optional language tag.
- Blockquotes:
> text.
A reminder of Markdown's lineage: John Gruber and Aaron Swartz designed it in 2004 as "an easy-to-read, easy-to-write plain text format." The CommonMark standardisation effort began in 2014, led by John MacFarlane (Pandoc), Jeff Atwood (Stack Overflow / Discourse), and engineers from GitHub, Reddit and Meteor. GitHub Flavored Markdown is a CommonMark superset adding tables, strikethrough, task lists, and autolinks.
More questions
Why is the text in my PDF blurry?
Because the converter rasterises the page at the browser's display density. On a non-Retina monitor the resulting image can look soft when zoomed in, since the canvas captures at roughly 96 DPI rather than print's typical 300 DPI. The fix is to render at higher density, html2canvas accepts a scale option (typically 2× for Retina-quality output), at the cost of larger file sizes.
Why doesn't my code block colour-highlight?
marked.js doesn't ship syntax highlighting by default, it just wraps fenced blocks in <pre><code class="language-…"> tags. Real highlighting needs a separate library like Prism.js or highlight.js, which this build doesn't include. The PDF will show your code in monospace but without the green-and-red colour theme you might expect from GitHub.
Can I include footnotes or a table of contents?
Footnotes ([^1] references and [^1]: definitions) are a GitHub render feature outside the standard GFM spec and are not parsed by this build. A table of contents requires either a Markdown extension (like markdown-it's TOC plugin) or hand-writing the link list. For both, Pandoc with its --toc flag is the right tool.
Will the PDF be tagged for accessibility?
No. The output is an image-of-pages PDF without semantic tags, alt text, or reading-order hints, it would not pass a PDF/UA conformance check. For accessibility-required work (government forms, public-sector docs, anything subject to WCAG / EN 301 549 / Section 508), use Pandoc + LaTeX with an accessibility filter, Adobe Acrobat Pro's tagging tools, or a server-side WeasyPrint pipeline.
Does anything get sent to a server?
No. The text never leaves your browser. Marked.js parses the Markdown locally, html2canvas paints to an off-screen canvas, jsPDF builds the PDF object, and the browser saves it. The libraries themselves load from a public CDN with subresource-integrity checks; they're fetched once and then cached. Once the page is loaded it works offline.