Files
pdfcraft/crates/export/src/lib.rs
T
Dylan M. Taylor e1d2f32e58 export, xfdf: cut over portable HTML writer and XFDF/FDF grammar to craft-libs (#778) (#7914)
* export, xfdf: cut over portable HTML writer and XFDF/FDF grammar to craft-libs (#778)

* fix(xfdf): align craft-xml rev with craft-xfdf and deref standalone El

* fix(xfdf): remove redundant deref on standalone(el, ns)

* xfdf, export: update craft-libs pin and add XFDF annotation round-trip test

* chore: align craft-xml rev with craft-xfdf

* chore: repin craft-xml to craft-libs main

* chore: repin craft-xml, craft-xfdf, craft-html to craft-libs main

* test(xfdf): pass &str to import_comments in round-trip test

* test(xfdf): bind dst.get(dst_ref) before as_dict

* test(fonts): import pdfcraft_cos::Stream in embedding tests

* test(xfdf): update newly added square annotation instead of widget[0]

* test(xfdf): read newly imported annotation at Annots.last() in roundtrip test
2026-11-19 22:42:25 -05:00

50 lines
1.8 KiB
Rust

//! pdfcraft-export — Export a PDF ▸ Word, HTML, RTF, Markdown (L4).
//!
//! The engine reduces each page to [`Page`]: paragraphs (text, box, size, bold/italic) and
//! images (encoded bytes and box), in reading order. The writers turn that into a flowing
//! document: headings are the paragraphs set larger than the body text; a block that
//! continues another on its line (an italic word, a link) is a run of that block's paragraph, and
//! a paragraph that wraps onto the next line runs on there. Word keeps pages with
//! rotated text, or text overlapped by artwork or watermark-sized text, as positioned, editable
//! shapes to avoid reflowing overlays; other pages flow with images inline.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
mod pptx;
mod zip;
pub use pptx::pptx;
pub use zip::Zip;
mod as_docx;
mod as_html;
mod as_markdown;
mod as_rtf;
mod as_word;
mod clip;
mod flow;
mod layout;
#[cfg(test)]
use as_docx::MAX_MEDIA;
pub(crate) use as_docx::hex;
pub use as_docx::{docx, docx_with_language};
pub use as_html::{html, html_simple, html_simple_with_language, html_with_language};
pub use as_markdown::markdown;
#[cfg(test)]
use as_markdown::{emphasis, paragraph};
pub use as_rtf::{rtf, rtf_with_title, rtf_with_title_checked};
pub use clip::{ClipBuilder, ClipSpan, ClipStyle, ClipText, MAX_CLIP_HTML_BYTES, MAX_CLIP_SPANS, MAX_CLIP_TEXT_BYTES, clip_html, font_family};
pub(crate) use craft_html::standalone::esc;
#[cfg(test)]
use craft_html::standalone::{allowed, base64};
#[cfg(test)]
use flow::list_item;
pub use layout::{Block, Cell, Image, Page, Table};
#[cfg(test)]
use layout::{LOOKUP_STEPS, MAX_COLS, body_size};
pub(crate) use layout::{Run, flowing_paragraphs, reading_order, tables};
#[cfg(test)]
mod tests;