Rust crate reference
pdfboss is a workspace of focused crates, all sharing one version. Add the ones you need with cargo add; each crate's API reference lives on docs.rs.
| Crate | Responsibility | Docs |
|---|---|---|
pdfboss-core | PDF syntax, objects, filters, cross-references and document model (ISO 32000) | docs.rs |
pdfboss-text | Font loading, encodings, ToUnicode CMaps and text extraction | docs.rs |
pdfboss-output | Layout analysis and output rendering: plain text and markdown | docs.rs |
pdfboss-encoding | Shared font encoding tables and glyph-name mappings (ISO 32000 Appendix D) | docs.rs |
pdfboss-jpx | Cleanroom JPEG 2000 (JPXDecode) decoder (ITU-T T.800) | docs.rs |
pdfboss-icc | Cleanroom ICC profile parser and colour transform (ICC.1:2010) | docs.rs |
pdfboss-render | Page rasterization to RGBA pixmaps and PNG, plus embedded-image extraction | docs.rs |
pdfboss-write | PDF creation: COS object writer, content canvas, composed elements (text, paragraph, image, link), outlines, attachments, page labels, viewer preferences, XMP metadata and document assembly | docs.rs |
pdfboss-style | CSS-subset themes for document composition | docs.rs |
pdfboss-markdown | CommonMark+GFM composed into themed PDFs | docs.rs |
pdfboss-aio | Async, range-fetching PDF access: huge files, many documents, remote HTTP sources | docs.rs |
pdfboss-cli | The pdfboss command-line tool | docs.rs |
pdfboss-tui | Terminal explorer for PDF internals: element tree, object inspector, hex view, page preview and Markdown preview | docs.rs |
pdfboss-py | PyO3 extension module pdfboss._pdfboss, built with maturin | not on crates.io; ships as the pdfboss wheel |
A further workspace member, pdfboss-testkit, is an internal PDF fixture builder for the test suite; it is not published.
Where to start
- Reading a document:
pdfboss_core::Document(open,load, and their_with_passwordtwins), thenpage,page_count,metadata,version. - Text and markdown:
pdfboss_output::{extract_text, extract_markdown}; positioned styled spans viapdfboss_text::extract_spans. - Rasterizing:
pdfboss_render::{render_page, render_page_with_options, render_page_reporting}andPixmap::save_png; embedded images viaextract_page_images. - Creating:
pdfboss_write::{Pdf, Page, Canvas, Content}; see Creating PDFs. - Composing Markdown:
pdfboss_markdown::to_pdfwith apdfboss_style::Theme; see Markdown to PDF. - Async and HTTP sources:
pdfboss_aio::AsyncDocument(open,open_url,from_bytes); see Async and remote documents. - Element iteration:
pdfboss_core::Document::elements(ElementOpts), a lazy iterator over physical and logical elements, and the asyncAsyncDocument::elements, which returns anElementStream; see Exploring PDF internals.
The guide chapters carry compiled examples for each of these; the Quickstart has the shortest end-to-end one.