pdf_annotations_converter/
core.rs

1/// Item that the parser emits.
2#[derive(Debug, Clone, PartialEq)]
3pub enum ParsedItem {
4    /// The file which was annotated.
5    File(String),
6    /// A page number indicator, first element is printed number, second is physical page.
7    PageNumber(u32, u32),
8    /// A roman page indicator
9    PageRoman(String),
10    /// A higlighted section.
11    Highlight(String),
12    /// An underlined section.
13    Underline(String),
14}
15
16/// The config provided to the parser.
17pub struct ParseConfig {
18    /// The offset of the first numbered page.
19    /// Set it to a negative value if physical page numbers are annotated to derive page number
20    /// from it.
21    /// Set it to positive if page numbers are annotated to derive physical page from it.
22    /// Set it to [0] if page numbers match physical page.
23    pub page_offset: i32,
24    /// If `true` page number indicators will be emitted.
25    pub page_numbers: bool,
26}
27
28impl Default for ParseConfig {
29    fn default() -> Self {
30        Self {
31            page_offset: 0,
32            page_numbers: false,
33        }
34    }
35}