Secure Rust library for parsing, inspecting, and generating Adobe InDesign IDML packages.
This project is an independent implementation. InDesign and IDML are trademarks of Adobe Inc. This project is not affiliated with, endorsed by, or sponsored by Adobe.
See SECURITY_IMPLEMENTATION_PLAN.md for the implementation plan, threat model, dependency policy, and local verification gate.
See RELEASE_PLAN.md for the milestone plan through the fully functional 1.0 release.
For large IDML packages, prefer visitor-style APIs when writing extracted text
or metadata to another sink. try_for_each_story_text_with_options resolves one
story at a time in designmap.xml order and allows the caller to stop on I/O or
application errors without collecting every story into one map first.
For layout-aware extraction, try_for_each_spread_text_frame_with_options,
try_for_each_spread_text_on_page_with_options, and
try_for_each_spread_text_in_rect_with_options resolve only matching frame
stories as they are visited.
For loss-aware workflows, IdmlDocument::try_for_each_preserved_entry exposes
master spreads and untyped resource entries in manifest order without requiring
callers to depend on internal map ordering.
For loaded document models, IdmlDocument::try_for_each_story_text visits
borrowed story text in manifest order without cloning every story into a map.
Loaded documents also expose try_for_each_spread_text_frame,
try_for_each_spread_text_on_page, and try_for_each_spread_text_in_rect for
borrowed layout-aware iteration.
The release gate compiles and runs the public examples:
cargo run --example read_text
cargo run --example build_basic
cargo run --example edit_story
cargo run --example roundtrip_file -- INPUT.idmlThe crate includes an optional companion binary, idml-text, behind the cli
feature. It extracts story text from an IDML package in designmap.xml order
or layout-resolved text from one spread, page, rectangle, or every spread. It
exposes the same archive, manifest, spread, and story parser limits used by the
library.
cargo run --features cli --bin idml-text -- INPUT.idml
cargo run --features cli --bin idml-text -- --all-spreads INPUT.idml
cargo run --features cli --bin idml-text -- --spread-id u10 --page-id p1 INPUT.idml
cargo run --features cli --bin idml-text -- --spread-id u10 --rect-points 0 0 100 100 INPUT.idml
cargo run --features cli --bin idml-text -- --max-entry-compression-ratio 100 INPUT.idml
cargo run --features cli --bin idml-text -- --max-archive-path-bytes 4096 INPUT.idmlRelease binaries for idml-text are intended to be attached to GitHub Releases
as companion artifacts. The crates.io package remains the Rust library API.
To build a native CLI release artifact locally:
scripts/build-cli-release.shThe script writes dist/idml-text-v<VERSION>-<TARGET> and a matching
.sha256 checksum file.
Private or license-unclear IDML samples can be placed in
tests/fixtures/private-idml/. That directory is ignored by git and blocked
from the publish package. When present, these optional local checks exercise
real files without making them part of the crate:
scripts/smoke_private_fixtures.sh
scripts/smoke_private_roundtrip.shThis project is dual-licensed:
license = "MIT OR Apache-2.0"The full license texts are available in LICENSE-MIT and LICENSE-APACHE.