lmpdf
lmpdf is a self-contained Rust and Typst lmcode host that generates deterministic, tagged PDF/A-2b and PDF/UA-1 documents and slide decks. It accepts the exact same typed calls as lmoffice docx and lmoffice pptx with bundled Latin, Arabic RTL, and CJK fonts.
Quick reference
npm install -g @lmctl-ai/lmctl
lmpdf --version
lmpdf docx --lmcode-schema --json
lmpdf inspect hello.pdf
| Route or command | Key methods or flags | Purpose |
|---|---|---|
| lmpdf docx | docx.create(path), heading, paragraph, table, footer_fields, markdown, html_doc, save | Render paginated, tagged PDF/A-2b and PDF/UA-1 documents from typed docx calls, Markdown, or html-doc@1 XHTML/CSS. |
| lmpdf pptx | pptx.create(path), slide, title_slide, text, bullet, table, bar_chart, markdown, save | Render 16:9 presentation slide decks (1280x720 px / 960x540 pt) to tagged PDF/A-2b and PDF/UA-1. |
| lmpdf inspect | lmpdf inspect FILE.pdf | Inspect a PDF and return a JSON summary with page, image, table, and hyperlink counts plus extracted text. |
| lmpdf docx --to-markdown | lmpdf docx --to-markdown FILE.pdf | Extract Markdown content from a generated PDF file. |
output = ARGV.len() > 0 ? ARGV[0] : "hello.pdf";
p = _lmcode_ cli="lmpdf docx" install="github:lmctl-ai/lmpdf@v0.2.19";
let doc = docx.create(${output});
doc.heading("Hello PDF", 1);
doc.paragraph("The same document calls can target lmoffice docx or lmpdf docx.");
doc.footer_fields("Page {PAGE} of {NUMPAGES}").save();
end _lmcode_
r = run_lmcode(p);
assert(r.ok, json_stringify(r));
Documentation pages
- Skill — authoring rules, CLI commands, inputs and outputs, safety rules, worked examples, and verification steps.
- Guide — Typst layout architecture, lmoffice parity, PDF/A-2b and PDF/UA-1 conformance, dry execution, and the standard lmcode_std_v3 library.
- Reference — complete CLI flags, docx and pptx schema types and methods, standard library catalog, and exit codes.