New: Add Markdown (.md) to Pdf conversion support#776
Open
huseyincancalti wants to merge 2 commits into
Open
Conversation
Parse Markdown with Markdig and compose the PDF directly from its syntax tree via QuestPDF, avoiding an HTML round-trip and a headless browser dependency.
Product.wxs enumerates every shipped DLL manually; the new NuGet dependencies were missing from that list, so the installed app threw a TypeInitializationException on ConversionJob_Markdown despite working fine when run from the raw build output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
.md→.pdfconversion, following the existingConversionJobpattern (modeled on
ConversionJob_ImageMagick).No matching upstream issue was found — searched Tichau/FileConverter for
markdown/
.md-related requests; the closest hit (#773) asks for theopposite direction (Excel/Docs/Text/PDF → Markdown), so it isn't
referenced here.
Pipeline: Markdig parses the Markdown into a syntax tree; that tree
is walked directly into QuestPDF's fluent document-composition API. No
HTML is generated or parsed as an intermediate step, since QuestPDF has
no HTML input — it exposes only its own C# composition API, so going
through HTML would mean parsing HTML back out for no benefit.
Why not a headless browser (Puppeteer/Chromium)? This project
bundles all its runtime dependencies at install time (see
ffmpeg/ghostscriptunderMiddleware/) and works fully offline. Aheadless-Chromium-based renderer downloads a ~300MB browser binary at
runtime, which breaks both of those properties. QuestPDF is a small,
pure-C# NuGet dependency resolved at build time like every other
package this project already uses — no extra runtime footprint, no
network access ever required.
Dependencies added:
Markdig1.3.2 — BSD-2-ClauseQuestPDF2026.7.0 — Community license (free for OSI-licensedopen-source projects; this project is GPL-3.0, which qualifies).
Used here under that Community license for this open-source
contribution.
Testing: built with zero new warnings; manually converted a
Markdown file covering headings, nested lists, an ordered list, a
fenced code block, a table, and inline formatting, and confirmed the
output PDF renders correctly.