1 comments

  • dillu_spur 5 hours ago

    Author here. Most .NET HTML-to-PDF options are either a headless-Chromium wrapper (150-400 MB, multi-second cold starts, painful or blocked on Azure Functions Windows Consumption) or an AGPL/commercial library with a dependency tree.

    Bhowra.Ink is a from-scratch pure-C# engine: one managed .NET 8 DLL of 913 KB, zero NuGet dependencies, no native binaries, no P/Invoke. It renders HTML5 + CSS (Grid, Flexbox, gradients, transforms, SVG) to PDF in-process.

    The playground linked above is itself running on an Azure Functions Windows Consumption plan (Y1/Dynamic), .NET 8, scaled to zero instances. So the cold start you get clicking it is the real one, not a warmed-up demo.

    Zero dependencies is literal: the .nupkg is one DLL in lib/net8.0, an empty dependency group, no runtimes/ folder. The only platform-specific call in the codebase is a registry read guarded by OperatingSystem.IsWindows().

    Sandbox-friendly by construction: converting to a byte[] touches no disk, and the bundled fonts are embedded resources inside the DLL rather than files on disk. Licensing also has an offline path - hand it a signed token via an env var and it never makes a network call, which matters if your egress is blocked.

    Other things it does: ~50 ms warm path for a typical invoice and ~1 s cold start including JIT; Arabic/Hebrew via real OpenType GSUB/GPOS shaping with word-level UAX #9 bidi; Devanagari shaping; PDF/A-2b, PDF/A-3b, PDF/UA-1 tagging, AES-256 (V5/R6, AESV3); Factur-X / ZUGFeRD embedding; byte-identical output if you pin CreatedOn. Full suite runs green on Windows and Linux in CI.

    Deliberately not supported, so you don't waste time discovering it:

    No JavaScript. <script> is skipped, a script-drawn <canvas> renders as an empty box, no CSS animations/transitions/:hover/:focus, no video/audio. It degrades gracefully rather than crashing, but if your document needs a JS runtime this is the wrong tool.

    Indic beyond Devanagari is not shaped - Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam and Lao are left unrendered rather than drawn wrong. They surface in FontDiagnostics, never silently dropped. CJK isn't bundled either; register a font.

    The bidi is a word-level approximation of UAX #9, not the full algorithm - no bracket pairs, no nested embedding levels.

    Factur-X and ZATCA are document-layer only: it embeds and tags your XML and packs your TLV values, and never generates, validates, signs or submits invoice XML. PDF/A is levels 2b and 3b only. Encryption emits AES-256 but /P is hardcoded allow-all, so there's no restrict-printing/copying API yet.

    NuGet (latest 1.0.9): https://www.nuget.org/packages/Bhowra.Ink

        dotnet add package Bhowra.Ink
    
        using Bhowra.Ink;
        byte[] pdf = HtmlConverter.ConvertToBytes(html);
    
    Commercial, with a fully functional watermarked trial - no page limit, no expiry. Flat annual pricing, no per-document fees, no AGPL.

    Happy to answer anything about the layout engine, the font stack, or the serverless side.