document_svg/lib.rs
1//! Bounded conversion of PDF, Office, web, text, diagram, CAD/CAM/3D, simulation,
2//! raster, chart, table, and math documents to deterministic SVG pages, plus SVG
3//! transforms and reverse packaging into Office, CAD, diagram, data, and UI-code formats.
4//!
5//! Use [`convert_path`] for normal file conversion. It detects supported inputs
6//! from their extensions or a bounded content prefix, writes one SVG per output
7//! page, and writes `conversion.json` beside the SVG files.
8//!
9//! Use the public [`cad`], [`ir`] and [`svg`] modules when working directly with
10//! CAD entities or constructing a page from custom drawing data.
11//!
12//! Call [`svg_to_document`] with one SVG or a directory of SVG pages to package
13//! Office, draw.io, CAD/CAM/3D, simulation, diagram, table, math, image, or UI-code
14//! output. Office exports preserve page appearance; they do not reconstruct the
15//! source application's paragraphs, cells, formulas, or editable shapes.
16
17#![cfg_attr(target_arch = "wasm32", allow(dead_code, unused_imports))]
18
19pub mod cad;
20pub mod chart;
21pub mod code;
22mod convert;
23pub mod diagram;
24pub mod document;
25mod drawio;
26mod error;
27mod geospatial;
28pub mod ir;
29mod jpeg2000;
30mod local_resource;
31pub mod math;
32pub mod metafile;
33mod ooxml;
34mod pdf;
35mod pdf_base14;
36pub mod qr;
37mod reverse;
38pub mod svg;
39pub mod table;
40pub mod transform;
41pub mod vectorize;
42
43pub use convert::{
44 ByteConversionReport, ByteConvertLimits, ConvertOptions, SourceFormat, SvgPage, TextSpan,
45 convert_bytes,
46};
47#[cfg(not(target_arch = "wasm32"))]
48pub use convert::{ConversionReport, PageReport, convert_path};
49pub use error::{Error, Result};
50/// Former name of [`ReverseFormat`], kept so existing callers still compile.
51#[cfg(not(target_arch = "wasm32"))]
52pub use reverse::ReverseFormat as OpenXmlFormat;
53/// Former name of [`svg_to_document`], kept so existing callers still compile.
54#[cfg(not(target_arch = "wasm32"))]
55pub use reverse::svg_to_document as svg_to_openxml;
56#[cfg(not(target_arch = "wasm32"))]
57pub use reverse::{ReverseFormat, ReverseOptions, ReverseReport, svg_to_document};
58pub use transform::{TransformOptions, transform_svg};