{"id":19905018,"url":"https://github.com/christiaanderidder/questpdf.markdown","last_synced_at":"2026-01-18T13:39:25.284Z","repository":{"id":206797178,"uuid":"717720247","full_name":"christiaanderidder/QuestPDF.Markdown","owner":"christiaanderidder","description":"QuestPDF.Markdown allows rendering markdown into a QuestPDF document","archived":false,"fork":false,"pushed_at":"2025-12-15T10:22:05.000Z","size":21165,"stargazers_count":54,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-18T09:28:05.139Z","etag":null,"topics":["csharp","markdig","markdown","pdf","pdf-converter","questpdf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christiaanderidder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["christiaanderidder"]}},"created_at":"2023-11-12T11:27:07.000Z","updated_at":"2025-12-15T10:21:34.000Z","dependencies_parsed_at":"2025-11-22T12:02:06.159Z","dependency_job_id":null,"html_url":"https://github.com/christiaanderidder/QuestPDF.Markdown","commit_stats":null,"previous_names":["christiaanderidder/questpdf.markdown"],"tags_count":67,"template":false,"template_full_name":null,"purl":"pkg:github/christiaanderidder/QuestPDF.Markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christiaanderidder%2FQuestPDF.Markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christiaanderidder%2FQuestPDF.Markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christiaanderidder%2FQuestPDF.Markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christiaanderidder%2FQuestPDF.Markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christiaanderidder","download_url":"https://codeload.github.com/christiaanderidder/QuestPDF.Markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christiaanderidder%2FQuestPDF.Markdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28536766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T13:04:05.990Z","status":"ssl_error","status_checked_at":"2026-01-18T13:01:44.092Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","markdig","markdown","pdf","pdf-converter","questpdf"],"created_at":"2024-11-12T20:30:55.949Z","updated_at":"2026-01-18T13:39:25.274Z","avatar_url":"https://github.com/christiaanderidder.png","language":"C#","funding_links":["https://github.com/sponsors/christiaanderidder"],"categories":[],"sub_categories":[],"readme":"# QuestPDF.Markdown \u003cimg src=\"/img/logo.png?raw=true\" width=\"128\" align=\"right\"\u003e\nQuestPDF.Markdown allows rendering markdown into a [QuestPDF](https://www.questpdf.com/) document using the [markdig](https://github.com/xoofx/markdig) parser.\n\n[![Nuget](https://img.shields.io/nuget/v/QuestPDF.Markdown)](https://www.nuget.org/packages/QuestPDF.Markdown)\n[![Nuget Prerelease](https://img.shields.io/nuget/vpre/QuestPDF.Markdown?label=nuget%20prerelease)](https://www.nuget.org/packages/QuestPDF.Markdown)\n\n\u003e [!IMPORTANT]  \n\u003e QuestPDF.Markdown is **not** a HTML-to-PDF conversion library and does intend to become one. It aims to use markdown to add basic user-provided content into PDFs without the pitfalls of HTML-to-PDF conversion.\n\n## Usage\n```csharp\nvar text = \"\"\"\n           # Hello, world!\n\n           *Greetings* from **markdown**!\n\n           \u003e Hello, back!\n           \"\"\";\n\nvar document = Document.Create(container =\u003e\n{\n    container.Page(page =\u003e\n    {\n        page.PageColor(Colors.White);\n        page.Margin(20);\n        page.Content().Markdown(text);\n    });\n});\n```\n\n![Usage](/img/usage.png?raw=true)\n\n### Styling the output\nThe styling used by QuestPDF.Markdown can be configured using the configure action.\n```csharp\nvar text = @\"\u003e Hello, world!\";\n\nvar document = Document.Create(container =\u003e\n{\n    container.Page(page =\u003e\n    {\n        page.PageColor(Colors.White);\n        page.Margin(20);\n        page.Content().Markdown(text, options =\u003e \n        {\n            options.BlockQuoteBorderColor = Colors.Red.Medium;\n            options.BlockQuoteBorderThickness = 5;\n        });\n    });\n});\n```\n\n### Rendering images\nBy default, downloading and rendering images is disabled.\nTo opt-in to loading images use the `ParsedMarkdownDocument.DownloadImages()` method.\nThis method will load any remote images, base64 images and local images (if a safe root path is provided).\n\nThe parsed markdown document can then be passed to the `Markdown()` extension method.\n```csharp\nvar text = @\"![title](https://placehold.co/100x50.jpg)\";\n\nvar markdown = ParsedMarkdownDocument.FromText(text);\nawait markdown.DownloadImages(\n    httpClient: myHttpClient /* Optionally provide your own HttpClient */\n    safeRootPath: \"/my/safe/path\" /* Optionally provide a safe root path from which relative local images paths can be read */\n);\n\nvar document = Document.Create(container =\u003e\n{\n    container.Page(page =\u003e\n    {\n        page.PageColor(Colors.White);\n        page.Margin(20);\n        page.Content().Markdown(markdown);\n    });\n});\n```\n\n### Rendering custom text\nIn some cases it can be helpful to render custom text content in the PDF (e.g. allowing a user to inject the page number).\n\nThis is possible by using the template tag feature:\n```csharp\nvar text = @\"This is page {currentPage}/{totalPages}\";\n\nvar document = Document.Create(container =\u003e\n{\n    container.Page(page =\u003e\n    {\n        page.PageColor(Colors.White);\n        page.Margin(20);\n        page.Content().Markdown(text, options =\u003e\n        {\n            options.AddTemplateTag(\"currentPage\", t =\u003e t.CurrentPageNumber());\n            options.AddTemplateTag(\"totalPages\", t =\u003e t.TotalPages());\n        }));\n    });\n});\n```\n\u003e [!NOTE]  \n\u003e Note that the template tags are only used to replace simple text content and not larger blocks like tables.\n\n## What's supported?\nThe aim of this library is to support all basic markdown functionality and some of the extensions supported by markdig.\n\nCurrently the following features are supported:\n- Headings\n- Block quotes\n- Code blocks\n- Lists (ordered, unordered)\n- Emphasis (bold, italic)\n- Task lists\n- Extra emphasis (subscript, superscript, strikethrough, marked, inserted)\n- Tables\n- Images (remote, base64 encoded, local paths)\n- HTML encoded entities (e.g. `\u0026amp;`, `\u0026lt;`, `\u0026gt;`)\n- Custom renderers for text content\n\nSupport for the following extensions is currently not planned:\n- Raw HTML\n- Math blocks\n- Diagrams\n\nA full sample can be found in [test.md](tests/QuestPDF.Markdown.Tests/test.md) and the resulting [test.pdf](tests/QuestPDF.Markdown.Tests/test.pdf).\n\n## Contributing\nTo quickly test changes made in the library, you can make use of the excellent QuestPDF previewer in combination with the QuestPDF.Markdown.Tests project and `dotnet watch`\n\nTo render the test markdown file in the companion app, first start the companion app and then run the following command in the root directory of the repository:\n```zsh\ncd ./tests/QuestPDF.Markdown.Tests \u0026\u0026 dotnet watch test --filter Name=Render\n```\n\nTo render the test markdown file in the previewer with additional background colors and margins, run the following command in the root directory of the repository:\n```zsh\ncd ./tests/QuestPDF.Markdown.Tests \u0026\u0026 dotnet watch test --filter Name=RenderDebug\n```\n\nAny changes made to the MarkdownRenderer class will be automatically reflected in the previewer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristiaanderidder%2Fquestpdf.markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristiaanderidder%2Fquestpdf.markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristiaanderidder%2Fquestpdf.markdown/lists"}