Skip to main content

rpdfium_doc/
lib.rs

1#![forbid(unsafe_code)]
2#![doc = "Document-level features for rpdfium — a faithful Rust port of PDFium."]
3//!
4//! This crate provides document structure types and parsers for PDF features
5//! beyond individual page content:
6//!
7//! - **Name trees** and **number trees** — generic sorted-key lookup structures
8//! - **Bookmarks** (outlines) — the hierarchical table of contents
9//! - **Document metadata** — title, author, dates from the `/Info` dictionary
10//! - **Destinations** and **actions** — navigation targets and interactive behaviors
11//! - **Page labels** — custom page numbering (roman, alphabetic, prefixed)
12//! - **Annotations** — interactive elements on pages (links, highlights, stamps, etc.)
13
14pub mod aaction;
15pub mod action;
16pub mod annot_list;
17pub mod annotation;
18pub mod annotation_appearance;
19pub mod ap_settings;
20pub mod ba_font_map;
21pub mod bookmark;
22pub mod bookmark_tree;
23pub mod catalog;
24pub mod default_appearance;
25pub mod destination;
26pub mod error;
27pub mod fdf;
28pub mod file_spec;
29pub mod form_control;
30pub mod form_field;
31pub mod generate_ap;
32pub mod icon_fit;
33pub mod interactive_form;
34pub mod javascript;
35pub mod link;
36pub mod link_list;
37pub mod metadata;
38pub mod name_tree;
39pub mod number_tree;
40pub mod page_label;
41pub mod signature;
42pub mod struct_element;
43pub mod struct_tree;
44pub mod variable_text;
45pub mod viewer_preferences;
46pub mod xmp;
47
48// Re-export key types at the crate root.
49pub use aaction::{AActionType, AdditionalActions, parse_additional_actions};
50pub use action::{Action, ActionChain, ActionType, parse_action_chain};
51pub use annot_list::{
52    annot_get_form_field_at_point, annotation_at_point, find_parent_annotation, parse_annotations,
53};
54#[allow(deprecated)]
55pub use annot_list::{get_annotation_at_point, get_form_field_at_point};
56pub use annotation::{
57    Annotation, AnnotationBorder, AnnotationFlags, AnnotationSubtypeData, AnnotationType,
58    AppearanceMode, BorderStyle, PdfValueType,
59};
60pub use annotation_appearance::AnnotationAppearance;
61pub use ap_settings::{IconProperties, MkDict, parse_icon_properties, parse_mk_dict};
62pub use ba_font_map::{BaFontMap, BaFontMapEntry, parse_default_appearance_font};
63#[allow(deprecated)]
64pub use bookmark::get_bookmark_by_title;
65pub use bookmark::{Bookmark, find_bookmark, next_sibling_bookmark};
66pub use bookmark_tree::parse_bookmarks;
67#[allow(deprecated)]
68pub use catalog::get_pdf_form_type;
69pub use catalog::{PageMode, PdfFormType, get_form_type, is_tagged, page_mode, pdf_form_type};
70pub use destination::{Destination, PageFit, collect_named_destinations, parse_destination};
71pub use error::{DocError, DocResult};
72pub use fdf::{FdfData, export_fdf, import_fdf};
73pub use file_spec::{
74    FileSpec, collect_attachments, decode_filename, encode_filename, parse_file_spec,
75};
76pub use form_control::{FormControl, HighlightingMode, TextPosition};
77pub use form_field::{ChoiceOption, FieldValue, FormField, FormFieldFlags, FormFieldType};
78pub use generate_ap::{generate_annot_ap, generate_annotation_appearance, generate_empty_ap};
79pub use icon_fit::{IconFit, ScaleMethod};
80pub use interactive_form::InteractiveForm;
81pub use javascript::{JavaScriptAction, collect_javascript_actions};
82pub use link::{Link, parse_link};
83pub use link_list::{
84    HitTestResult, LinkObject, collect_links, find_link_at_position, link_at_point, link_enumerate,
85    link_get_link_at_point,
86};
87#[allow(deprecated)]
88pub use link_list::{enumerate, enumerate_links, get_link_at_point};
89pub use metadata::{DocumentMetadata, parse_metadata};
90pub use name_tree::NameTree;
91pub use number_tree::NumberTree;
92pub use page_label::{PageLabel, PageLabelStyle, format_label, parse_page_labels};
93pub use signature::{DocMdpPermission, SignatureObject, collect_signatures};
94pub use struct_element::{AttributeValue, StructAttribute, StructElement};
95pub use struct_tree::{
96    ElementsForPage, McidMapping, PageStructure, StructTree, find_elements_for_mcid,
97};
98pub use variable_text::{
99    Alignment, Line, LineInfo, Section, VariableText, VtFontProvider, VtIterator, VtWordIterator,
100    Word, WordInfo, WordPlace, WordRange,
101};
102pub use viewer_preferences::{DuplexMode, ReadingDirection, ViewerPreferences};
103pub use xmp::{SharedFormType, XmpMetadata, check_for_shared_form};