pub struct DocumentStructure {
pub current_page: u32,
/* private fields */
}Expand description
Document-level structural records, parallel to
DisplayList.
The PostScript interpreter populates this via pdfmark operators; the
PDF reader populates it from a parsed document’s structural API. The
buffer is document-global (not VM-level), so save / restore do
not roll it back — records issued before a restore survive.
Fields§
§current_page: u32Count of completed showpage calls so far. The interpreter’s
showpage continuation increments this. Page-scoped records
(annotations, page boxes) that omit an explicit /Page key
default to current_page + 1 — i.e. the page currently being
assembled. So after N showpages, current_page == N and the
page-being-assembled is N + 1.
PostScript-interpreter concern; non-PS producers can leave this
at the default 0 and set explicit page indices on each record.
Implementations§
Source§impl DocumentStructure
impl DocumentStructure
pub fn new() -> Self
Sourcepub fn push(&mut self, record: StructuralRecord)
pub fn push(&mut self, record: StructuralRecord)
Append a record; ordering is preserved.
Sourcepub fn records(&self) -> &[StructuralRecord]
pub fn records(&self) -> &[StructuralRecord]
Read-only view of accumulated records.
Sourcepub fn drain(&mut self) -> Vec<StructuralRecord>
pub fn drain(&mut self) -> Vec<StructuralRecord>
Take ownership of the records, leaving the buffer empty. Used by the PDF output device once at end of job.
Trait Implementations§
Source§impl Clone for DocumentStructure
impl Clone for DocumentStructure
Source§fn clone(&self) -> DocumentStructure
fn clone(&self) -> DocumentStructure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more