Skip to main content

Crate rpdfium

Crate rpdfium 

Source
Expand description

rpdfium — a faithful Rust port of Google’s PDFium PDF rendering engine.

Re-exports§

pub use arc::ArcDocument;
pub use arc::ArcLibrary;
pub use arc::ArcPage;

Modules§

arc
Arc-based wrappers for WASM and async use cases.

Structs§

Annotation
A PDF annotation parsed from a page’s /Annots array.
AnnotationBorder
Annotation border specification.
AnnotationFlags
Annotation flags (ISO 32000-2 section 12.5.3, Table 165).
AnnotationSubtypeData
Subtype-specific annotation data.
Bitmap
A bitmap image buffer.
Bookmark
A single bookmark entry in the document outline.
CharOrigin
Page-space origin of a character (upstream CFX_PointF from CharInfo::origin_).
CharRect
Bounding rectangle for a character or merged selection region.
Color
A color value with components in the current color space.
ColorScheme
Forced color scheme for accessibility rendering (high-contrast mode). Corresponds to CPDF_RenderOptions::ColorScheme.
Document
A parsed PDF document, borrowing from the Library.
DocumentMetadata
Document metadata extracted from the /Info dictionary.
ElementsForPage
An iterator over structure elements that reference a specific page.
FdfData
In-memory FDF (Forms Data Format) data.
FileSpec
A parsed PDF file specification dictionary.
FolderFontScanner
Scans system font directories for matching fonts.
FontMatch
Result of a font lookup.
FontRequest
Request describing the font to find.
FormFieldFlags
Form field flag bits (/Ff).
GlyphUsageTracker
Tracks which glyphs have been used during text layout.
HitTestResult
Result of a link hit test.
InteractiveForm
A parsed interactive form (AcroForm).
JavaScriptAction
A document-level JavaScript action entry.
Library
The top-level library instance.
Link
A link extracted from page text.
LinkObject
A typed view of a link annotation for introspection.
Matrix
A 2D affine transformation matrix.
McidMapping
Mapping from (page ObjectId, MCID) to structure element information.
Name
A PDF name object.
NameTree
A parsed name tree mapping string keys to values of type V.
NumberTree
A parsed number tree mapping integer keys to values of type V.
OCContext
Optional content visibility context.
ObjectId
Unique identifier for a PDF indirect object.
OpenOptions
Options for opening a PDF document.
Page
A single page within a Document.
PageLabel
A page label specification that applies from a given page index onward.
PageStructure
Structure elements filtered for a specific page.
PdfString
A PDF string with encoding-aware conversion.
PdfVersion
PDF file version extracted from the header.
Point
A point in 2D space.
Rect
A rectangle in PDF coordinate space.
RenderConfig
Configuration for rendering a page to a bitmap.
RgbaColor
An RGBA color value with 8 bits per component.
SearchOptions
Options for text search (upstream FPDF_SEARCH_FLAGS).
SearchResult
A search result with start/end character indices and the matched text.
SignatureObject
A digital signature field parsed from a PDF’s AcroForm.
Size
A size with width and height.
StructAttribute
A single attribute dictionary associated with a structure element.
StructElement
A single node in the structure tree.
StructTree
The parsed structure tree of a tagged PDF document.
TextCharacter
A single extracted character with its position, size, and font metadata.
TextExtractor
Extracts text characters from a DisplayTree by visiting text nodes.
TextPage
Extracted text from a single PDF page, with character-level position data.
TextPageFind
Stateful text search matching upstream PDFium’s CPDF_TextPageFind.
ViewerPreferences
Parsed viewer preferences from the /ViewerPreferences dictionary.

Enums§

Action
A PDF action associated with a bookmark, link, or other trigger.
ActionType
Coarse action type classification matching PDFACTION_* constants in PDFium’s fpdf_doc.h.
AnnotationType
Annotation subtypes defined by the PDF specification.
AttributeValue
A value in a structure attribute dictionary.
BitmapFormat
Pixel format for bitmap data.
BorderStyle
Border styles for annotations.
CharType
Destination
A destination within a PDF document.
DisplayNode
A node in the display tree.
DocError
Errors that can occur during document structure parsing.
DocMdpPermission
The DocMDP (Modification Detection and Prevention) permission level.
DuplexMode
Duplex printing mode.
Error
Unified error type for the rpdfium facade.
FieldValue
A typed value that can be set on a form field.
FileIdentifierType
Selects which of the two PDF file identifiers to retrieve.
FontWeight
Font weight classification.
LinkKind
The kind of extracted link.
Object
A PDF object value.
PageActionType
Event type for page-level additional actions (/AA on a page dict).
PageError
Errors that can occur during page interpretation and traversal.
PageFit
How a page should be displayed when navigating to a destination.
PageLabelStyle
The numbering style for page labels.
PageMode
The initial display mode for the document’s pages.
ParseError
Syntax-level parse error for PDF objects.
ParsingMode
Parsing mode controlling how strictly the PDF specification is enforced.
PdfError
Top-level error type for rpdfium operations.
PdfFormType
The type of interactive form contained in a PDF document.
PdfStringEncoding
The encoding used by a PdfString.
ReadingDirection
Reading direction for the document.
RenderError
Errors that can occur during rendering.
StreamData
Represents the raw (undecoded) data of a PDF stream.
UsageType
The intended use for the content visibility evaluation.

Traits§

DisplayVisitor
Visitor trait for traversing the display tree.
FontMapper
Trait for finding system fonts.
PdfReader
Custom PDF data source, equivalent to FPDF_FILEACCESS.

Functions§

base14_substitute
Map a Base-14 PostScript font name to a common system font family name.
collect_attachments
Collect all embedded file attachments from the document catalog.
collect_javascript_actions
Collect all JavaScript actions from a document catalog.
collect_links
Collect all link annotations from a page’s annotation list.
collect_named_destinations
Collects all named destinations from the document catalog.
collect_signatures
Collect all digital signature fields from the document’s AcroForm.
compute_page_transform
Compute a transformation matrix from PDF page coordinates to device pixels.
device_to_page
Convert device (pixel) coordinates to PDF page coordinates.
enumerateDeprecated
Deprecated: use link_enumerate() or collect_links() instead.
enumerate_linksDeprecated
Deprecated: use link_enumerate() or collect_links() instead.
export_fdf
Export all field values from an interactive form into FDF data.
extract_links
Extract links from text. O(n) scan.
find_bookmark
Search for the first bookmark with the given title using iterative DFS.
find_link_at_position
Find a link annotation at the given point.
format_label
Format a page label for the given page offset within its range.
get_bookmark_by_titleDeprecated
Non-upstream alias — use find_bookmark() instead.
get_link_at_pointDeprecated
Deprecated: use link_get_link_at_point() or link_at_point() instead.
import_fdf
Import FDF data into an interactive form, updating matching fields.
is_tagged
Returns true if the document is a tagged PDF.
link_at_point
Find a link annotation at the given point and return it as a LinkObject.
link_enumerate
ADR-019 alias for collect_links.
link_get_link_at_point
ADR-019 alias for link_at_point().
next_sibling_bookmark
Returns the next sibling of bookmark within siblings, or None if bookmark is the last in the slice.
page_mode
Returns the document’s page mode from the catalog /PageMode entry.
page_to_device
Convert PDF page coordinates to device (pixel) coordinates.
parse_annotations
Parse all annotations from a page’s /Annots array.
parse_bookmarks
Parse the bookmark tree from the document catalog.
parse_destination
Parse a destination from a PDF object.
parse_metadata
Parse document metadata from an /Info dictionary object.
parse_page_labels
Parse page labels from the document catalog’s /PageLabels entry.
render
Render a display tree to a bitmap using the default backend.
render_with_images
Render a display tree with image decoding support.
search
Search for all occurrences of query in text (case-sensitive).
search_case_insensitive
Search for all occurrences of query in text (case-insensitive).
search_consecutive
Search for all overlapping (consecutive) occurrences of query in text.
search_normalized
Search for all occurrences of query in text with NFC normalization applied to both inputs before comparison.
search_normalized_case_insensitive
Search for all occurrences of query in text with NFC normalization and case-insensitive comparison.
search_whole_word
Search for all whole-word occurrences of query in text (case-sensitive).
search_whole_word_case_insensitive
Search for all whole-word occurrences of query in text (case-insensitive).
segment_lines
Segment a sequence of characters into lines by grouping on y-position.
segment_words
Segment a sequence of characters into words by detecting gaps.
subset_truetype_font
Subset a TrueType font to include only the specified glyphs.

Type Aliases§

DocResult
Convenience result alias for DocError.
PdfResult
A specialized Result type for rpdfium operations.
Result
Convenience result alias for Error.