pub enum StructType {
Show 37 variants
Document,
Part,
Art,
Sect,
Div,
P,
H,
H1,
H2,
H3,
H4,
H5,
H6,
L,
LI,
Lbl,
LBody,
Table,
TR,
TH,
TD,
THead,
TBody,
TFoot,
Span,
Quote,
Note,
Reference,
BibEntry,
Code,
Link,
Annot,
WB,
Figure,
Formula,
Form,
Custom(String),
}Expand description
Standard structure types from PDF spec Section 14.8.4.
These are the standard structure types defined by the PDF specification. Custom types can be mapped to standard types via the RoleMap.
Variants§
Document
Document root
Part
Part (major division)
Art
Article
Sect
Section
Div
Division
P
Paragraph
H
Heading level 1-6
H1
Heading level 1
H2
Heading level 2
H3
Heading level 3
H4
Heading level 4
H5
Heading level 5
H6
Heading level 6
L
List
LI
List item
Lbl
Label (list item marker)
LBody
List body (list item content)
Table
Table
TR
Table row
TH
Table header cell
TD
Table data cell
THead
Table header group
TBody
Table body group
TFoot
Table footer group
Span
Span (inline generic)
Quote
Quote
Note
Note
Reference
Reference
BibEntry
Bibliographic entry
Code
Code
Link
Link
Annot
Annotation
WB
Word break - explicit word boundary in structure tree (PDF 1.5+)
Per PDF spec Section 14.8.4.4, WB elements mark word boundaries in languages that do not use spaces between words (e.g., CJK).
Figure
Figure
Formula
Formula
Form
Form (input field)
Custom(String)
Custom structure type not defined in the PDF specification
Implementations§
Source§impl StructType
impl StructType
Sourcepub fn from_str(s: &str) -> Self
pub fn from_str(s: &str) -> Self
Parse structure type from string (e.g., “/P” -> StructType::P)
Sourcepub fn is_heading(&self) -> bool
pub fn is_heading(&self) -> bool
Check if this is a heading type (H, H1-H6)
Sourcepub fn heading_level(&self) -> Option<u8>
pub fn heading_level(&self) -> Option<u8>
Get heading level (1-6) if this is a heading type
Sourcepub fn is_word_break(&self) -> bool
pub fn is_word_break(&self) -> bool
Check if this is a word break element (WB)
Word break elements mark explicit word boundaries in languages that don’t use spaces (e.g., CJK). When encountered during text extraction, a space should be inserted.
Sourcepub fn markdown_prefix(&self) -> Option<&'static str>
pub fn markdown_prefix(&self) -> Option<&'static str>
Get markdown prefix for this structure type