1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//! PDF manipulation: pages, encryption, watermarks, text replacement, and more.
//!
//! All operations work on [`lopdf::Document`] objects, which can be loaded
//! from a file (`Document::load`) or obtained from another `pdf-manip` call.
//! Most functions return [`Result<_, ManipError>`].
//!
//! This crate's public API is panic-free. Errors are returned as `Result<T, ManipError>`.
//!
//! **Note on page numbering:** all page indices throughout this crate are
//! **1-based** to match PDF conventions.
//!
//! # Quick Start
//!
//! ```no_run
//! use lopdf::Document;
//! use pdf_manip::pages;
//! use pdf_manip::encrypt::{EncryptionAlgorithm, encrypt_and_save, EncryptConfig, Permissions};
//!
//! // Merge two PDFs.
//! let mut merged = pages::merge(&["a.pdf", "b.pdf"]).unwrap();
//! merged.save("merged.pdf").unwrap();
//!
//! // Extract pages 1–3 from a document.
//! let doc = Document::load("report.pdf").unwrap();
//! let mut subset = pages::extract_pages(&doc, &[1, 2, 3]).unwrap();
//! subset.save("pages_1_to_3.pdf").unwrap();
//!
//! // Encrypt with AES-256.
//! let mut doc = Document::load("sensitive.pdf").unwrap();
//! let cfg = EncryptConfig {
//! owner_password: b"owner_pw".to_vec(),
//! user_password: b"user_pw".to_vec(),
//! algorithm: EncryptionAlgorithm::Aes256,
//! permissions: Permissions::allow_all(),
//! };
//! let out = std::fs::File::create("sensitive_enc.pdf").unwrap();
//! encrypt_and_save(&mut doc, &cfg, out).unwrap();
//! ```
//!
//! # Modules
//!
//! Functions are accessed through their sub-modules rather than re-exports:
//!
//! | Module | Operations |
//! |---|---|
//! | [`pages`] | `merge`, `split`, `extract_pages`, `delete_pages`, `insert_pages`, `rotate_pages` |
//! | [`encrypt`] | `encrypt_document`, `remove_encryption`, AES-256 / RC4 |
//! | [`watermark`] | Text and image watermarks |
//! | [`optimize`] | Stream compression, object deduplication |
//! | [`bookmarks`] | Read and write document outline / bookmarks |
//! | [`text_replace`] | Search-and-replace in content streams |
//! | [`header_footer`] | Add headers and footers to pages |
// Copyright (c) 2026 Innovation Trigger B.V.
//
// PDFluent is available under two licences, at your option: the GNU AGPLv3, or
// the PDFluent Commercial Licence. See the LICENSE file in this repository --
// that file travels with the copy you received, which a URL does not.
/// Wall-clock time that is safe on wasm32, where `SystemTime::now()` panics.
pub
pub
pub
pub
/// Embedding a caller-supplied Unicode font, so a replacement can contain
/// characters the document's own fonts have no glyph for.
pub use ;
pub use ;
pub use ;