pub struct Page<'a> { /* private fields */ }Expand description
A PDF page.
Implementations§
Source§impl<'a> Page<'a>
impl<'a> Page<'a>
Sourcepub fn operations(&self) -> UntypedIter<'_> ⓘ
pub fn operations(&self) -> UntypedIter<'_> ⓘ
Get the operations of the content stream of the page.
Sourcepub fn typed_operations(&self) -> TypedIter<'_> ⓘ
pub fn typed_operations(&self) -> TypedIter<'_> ⓘ
Return an iterator over the operators in the page’s content stream.
Examples found in repository?
examples/iterate.rs (line 20)
7fn main() {
8 eprintln!(
9 "{:?}",
10 PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../hayro-render/pdfs/text_with_rise.pdf")
11 );
12 let data = std::fs::read(
13 PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../hayro-render/pdfs/text_with_rise.pdf"),
14 )
15 .unwrap();
16 let pdf = Pdf::new(Arc::new(data)).unwrap();
17 let pages = pdf.pages().unwrap();
18
19 for page in pages {
20 for op in page.typed_operations() {
21 println!("{:?}", op);
22 }
23 }
24}Auto Trait Implementations§
impl<'a> !Freeze for Page<'a>
impl<'a> !RefUnwindSafe for Page<'a>
impl<'a> Send for Page<'a>
impl<'a> !Sync for Page<'a>
impl<'a> Unpin for Page<'a>
impl<'a> !UnwindSafe for Page<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more