pub struct PdfMeta { /* private fields */ }Expand description
The parsed document with its pages in document order.
Implementations§
Source§impl PdfMeta
impl PdfMeta
Sourcepub fn open(bytes: &[u8]) -> Option<Self>
pub fn open(bytes: &[u8]) -> Option<Self>
Load bytes (with the parser’s xref/stream repairs); None when lopdf
cannot read the file at all, or when it is encrypted beyond the empty
user password.
Sourcepub fn open_with_password(
bytes: &[u8],
password: Option<&str>,
) -> Result<Option<Self>, PdfError>
pub fn open_with_password( bytes: &[u8], password: Option<&str>, ) -> Result<Option<Self>, PdfError>
open with the document’s password. Ok(None): lopdf
cannot read the file (pdfium’s turn, when compiled in); Err: the file
is encrypted and the password is missing or wrong — the error docling
raises too, instead of a document whose every stream decodes to nothing.
Sourcepub fn page_count(&self) -> usize
pub fn page_count(&self) -> usize
Number of pages (FPDF_GetPageCount).
Sourcepub fn geometry(&self, index: usize) -> Option<PageGeom>
pub fn geometry(&self, index: usize) -> Option<PageGeom>
Display geometry of the 0-based index; None past the last page.
Sourcepub fn links(&self, index: usize) -> Vec<LinkAnnot>
pub fn links(&self, index: usize) -> Vec<LinkAnnot>
The URI link annotations of the 0-based index, as top-left-origin
rects in the page’s unrotated content frame — the frame every text
coordinate lives in — counted from the display box’s corner like the
glyphs are, restricted to the web/mail/tel schemes the Markdown export
renders (extract_links’s rule). Empty past the last page.
Auto Trait Implementations§
impl !RefUnwindSafe for PdfMeta
impl !UnwindSafe for PdfMeta
impl Freeze for PdfMeta
impl Send for PdfMeta
impl Sync for PdfMeta
impl Unpin for PdfMeta
impl UnsafeUnpin for PdfMeta
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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