Skip to main content

pdfrum_edit/
lib.rs

1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4// Everything here is written *from* untrusted input: index with `get()`.
5#![warn(clippy::indexing_slicing)]
6
7// Every module is private and the `pub use` block below is the whole surface,
8// so an item is reachable exactly one way and reading that block is reading
9// the API. Siblings still reach
10// across — `write` names `encrypt`, `content::marks` names `write::object` —
11// which is what the `pub(crate)` on a few *sub*modules is for; at this level
12// `mod` already means crate-visible.
13mod attach;
14mod build_graph;
15mod builders;
16mod canvas;
17mod content;
18mod doc;
19mod encrypt;
20mod error;
21mod flatten;
22mod font;
23mod image;
24mod import;
25mod info;
26mod names;
27mod pages;
28mod pdfa_convert;
29mod stamp;
30#[cfg(feature = "svg-import")]
31mod svg_ingest;
32#[cfg(feature = "svg-text")]
33mod svg_text;
34mod write;
35
36pub use attach::{
37    AttachmentOptions, AttachmentOptionsBuilder, add_attachment, delete_attachment,
38    remove_attachment, set_attachment_description, set_attachment_file, set_attachment_param,
39};
40pub use build_graph::build_graph;
41pub use builders::{ImageBuilder, PathBuilder, TextBuilder};
42#[cfg(feature = "svg-import")]
43pub use canvas::SvgForm;
44pub use canvas::{Canvas, Dash, Fill, LineCap, LineJoin, MiterLimit, Paint, Stroke};
45pub use content::{
46    ContentsShape, PageRewrite, Regenerated, ResourceTable, ShareCounts, apply_rewrite, regenerate,
47    shared_objects, write_float, write_matrix, write_point, write_rect,
48};
49pub use doc::EditDoc;
50pub use encrypt::{Encryptor, IvSource};
51pub use error::Error;
52pub use flatten::{FlattenMode, Flattened, UnknownFlattenMode, flatten};
53pub use font::embed::{EmbeddedFont, FontEncoding, MissingGlyph, string_width};
54pub use font::{GidMap, Subsetted, subset};
55pub use image::{EmbeddedImage, PixelFormat};
56pub use import::{ImportOptions, NUpOptions, PageRange, import_pages, n_page_to_one};
57pub use info::{pdf_date, set_info_entry};
58pub use pages::{PageBox, add_blank_page, delete_pages, set_page_box, set_page_rotation};
59pub use pdfa_convert::{convert as to_pdfa, pdf_date_to_iso8601};
60pub use pdfrum_font::StandardFont;
61pub use stamp::{StampOptions, StampOptionsBuilder, StampPosition, UnknownStampPosition};
62#[cfg(feature = "svg-import")]
63pub use svg_ingest::{SvgFit, SvgIngestReport, Unsupported, UnsupportedItem};
64#[cfg(feature = "svg-text")]
65pub use svg_text::SvgFonts;
66pub use write::id::{FileId, IdSource};
67pub use write::{Encryption, SaveMode, SaveOptions, save};