mbtpdf

    Download zip
    Author
    Version
    0.2.0
    License
    Apache-2.0
    Last updated
    2 days ago
    Downloads
    98

    Dependencies

    #bobzhang/mbtpdf

    PDF toolchain implemented in MoonBit, centered on an in-memory PDF object model plus packages for parsing, writing, and document-level operations (merge, text extraction, encryption, etc.).

    #Packages

    • Libraries live under core/, syntax/, codec/, crypto/, font/, graphics/, document/, text/, io/.
    • CLI entry points live under cmd/ (e.g. cmd/pdfhello, cmd/pdfextracttext, cmd/pdfmergeexample).

    #Documentation

    • docs/README.md
    • docs/architecture.md
    • docs/e2e-tests.md
    • docs/pdf-format-tutorial.md
    • docs/testing.md
    • docs/logging-hygiene.md

    #Quick start

    # Run the "hello world" PDF generator. moon run cmd/pdfhello # Run a multi-page interactive showcase PDF (art + layers + links). moon run cmd/pdfshowcase # Run a clickable "escape maze" PDF (links + layers + map). moon run cmd/pdfmaze # Run a beamer-ish slide deck generator (links + bookmarks + speaker notes layer). moon run cmd/pdfbeamer # Run a choose-your-own-adventure storybook (interactive buttons + spoilers layer). moon run cmd/pdfstorybook # Run a birthday card generator (balloons + party mode + secret layer). moon run cmd/pdfbirthday # Run a printable mini escape-room board game (clickable board + hint/solution layers). moon run cmd/pdfboardgame # Run a tiny printable coloring book (COLOR + ANSWERS layers). moon run cmd/pdfcoloring # Run interactive printable recipe cards (links + bookmarks + SWAPS layer). moon run cmd/pdfrecipe # Run an interactive travel brochure (tabs + coupons + optional layers). moon run cmd/pdftravel # Run a printable paper doll (mix-and-match outfit layers + poster pages). moon run cmd/pdfpaperdoll

    #Testing

    moon test moon check moon coverage analyze

    #Local CI gate

    # Format check + lint + tests + per-package coverage gate (default 95%). scripts/devcheck.sh

    #Coverage gate

    CI enforces minimum per-package coverage (excluding cmd/* and io/*):

    scripts/coverage_gate.sh --threshold 95

    #Logging hygiene (tests)

    Many packages emit expected warnings when fuzzing malformed inputs. Tests should keep output quiet:

    // Prefer scoped suppression so state is restored even on failure.
    @pdfe.with_logger(_ => (), fn() { ... })
    @pdfe.with_silenced_logs(fn() { ... })

    // Some code paths print via PdfUtil; you can silence those too:
    @pdfutil.quiet.val = true

    Encryption

    Encryption settings.

    EncryptionMethod

    Encryption methods.

    Pdf

    Root facade for the mbtpdf module.

    Most functionality lives in subpackages (e.g. @pdfread, @pdfwrite, @pdfpage, @pdftext). This package re-exports a small set of common entry points and provides a couple of convenience helpers.

    PdfObject

    Root facade for the mbtpdf module.

    Most functionality lives in subpackages (e.g. @pdfread, @pdfwrite, @pdfpage, @pdftext). This package re-exports a small set of common entry points and provides a couple of convenience helpers.

    Permission

    Permissions for PDF encryption.

    Stream

    Root facade for the mbtpdf module.

    Most functionality lives in subpackages (e.g. @pdfread, @pdfwrite, @pdfpage, @pdftext). This package re-exports a small set of common entry points and provides a couple of convenience helpers.

    read_file

    async fn read_file(filename : String, revision? : Int, user_password? : String, owner_password? : String) ->
    Pdf

    Read a PDF from a file.

    write_file

    async fn write_file(pdf :
    Pdf
    , filename : String) -> Unit

    Write a PDF to a file.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io