Skip to main content

PdfProcessResult

Struct PdfProcessResult 

Source
pub struct PdfProcessResult {
Show 18 fields pub pdf_type: PdfType, pub markdown: Option<String>, pub page_count: u32, pub processing_time_ms: u64, pub pages_needing_ocr: Vec<u32>, pub ocr_reasons_by_page: Vec<PageOcrReasons>, pub title: Option<String>, pub author: Option<String>, pub subject: Option<String>, pub keywords: Option<String>, pub creator: Option<String>, pub producer: Option<String>, pub creation_date: Option<String>, pub mod_date: Option<String>, pub confidence: f32, pub layout: LayoutComplexity, pub has_encoding_issues: bool, pub cmap_gaps: Vec<FontCMapGaps>,
}
Expand description

High-level PDF processing result.

Fields§

§pdf_type: PdfType

The detected PDF type.

§markdown: Option<String>

Markdown output (populated in ProcessMode::Full, None otherwise).

§page_count: u32

Page count.

§processing_time_ms: u64

Processing time in milliseconds.

§pages_needing_ocr: Vec<u32>

1-indexed page numbers that need OCR.

§ocr_reasons_by_page: Vec<PageOcrReasons>

Machine-readable OCR reasons by 1-indexed page.

§title: Option<String>

The /Title of the document information dictionary, decoded as a PDF text string (UTF-16 or UTF-8 after a byte order mark, PDFDocEncoding otherwise; see PdfTypeResult::title). None when the entry is missing or not a string. The entries below follow the same decoding and missing-value rule.

§author: Option<String>

The document information dictionary’s /Author.

§subject: Option<String>

The document information dictionary’s /Subject.

§keywords: Option<String>

The document information dictionary’s /Keywords.

§creator: Option<String>

The document information dictionary’s /Creator: the application the document was authored in.

§producer: Option<String>

The document information dictionary’s /Producer: the application that wrote the PDF.

§creation_date: Option<String>

The document information dictionary’s /CreationDate as written, a PDF date string such as D:20240115103000+01'00', neither validated nor converted.

§mod_date: Option<String>

The document information dictionary’s /ModDate as written, like creation_date.

§confidence: f32

Detection confidence score (0.0–1.0).

§layout: LayoutComplexity

Layout complexity analysis (tables, multi-column detection).

§has_encoding_issues: bool

true when broken font encodings are detected (garbled text, replacement characters). Clients should fall back to OCR.

§cmap_gaps: Vec<FontCMapGaps>

The fonts whose ToUnicode CMap — or, for a font without one, the embedded program’s cmap table — lacked an entry for a code the document shows through it, with the counts of codes shown, read from their neighbours and left as U+FFFD (see FontCMapGaps). Always empty in ProcessMode::DetectOnly, which decodes no text; otherwise empty when every such code had an entry.

Trait Implementations§

Source§

impl Debug for PdfProcessResult

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.