Skip to main content

Crate pdfpurr

Crate pdfpurr 

Source
Expand description

§PDFPurr 🐱📄

The Ultimate Rust PDF Library

PDFPurr is a comprehensive, standards-compliant, and accessibility-focused PDF library written in pure Rust. It provides everything you need to work with PDF files: reading, writing, editing, and rendering.

§Features

  • Comprehensive: Full-featured PDF manipulation
  • Standards-Compliant: Support for PDF 2.0, PDF/A, PDF/UA, PDF/X
  • Accessible: First-class support for accessibility (PDF/UA)
  • Memory-Safe: Pure Rust implementation
  • High-Performance: Optimized for speed and low memory usage

§Project Status

⚠️ Early Development: PDFPurr is currently in the foundation phase. The API is not stable and breaking changes are expected.

§Quick Start

use pdfpurr::Document;

// Create a new PDF document
let mut doc = Document::new();
doc.add_page(612.0, 792.0).unwrap();
let bytes = doc.to_bytes().unwrap();

// Parse it back
let doc = Document::from_bytes(&bytes).unwrap();
assert_eq!(doc.page_count().unwrap(), 1);

§Architecture

PDFPurr is organized into several core modules:

  • core: Low-level PDF primitives and object model
  • parser: PDF file parsing and lexical analysis
  • content: Content stream processing
  • fonts: Font handling and embedding
  • images: Image processing and extraction
  • encryption: Security and encryption
  • forms: Form handling (AcroForms)
  • structure: Outlines, annotations, and metadata
  • accessibility: PDF/UA and tagged PDF support
  • standards: Standards compliance (PDF/A, PDF/X, etc.)

§Examples

See the examples/ directory for comprehensive examples.

§Documentation

For more information, see:

Re-exports§

pub use document::Document;
pub use error::PdfError;
pub use error::PdfResult;
pub use crate::core::DictExt;
pub use crate::core::Dictionary;
pub use crate::core::IndirectRef;
pub use crate::core::Object;
pub use crate::core::ObjectId;
pub use crate::core::PdfName;
pub use crate::core::PdfStream;
pub use crate::core::PdfString;
pub use crate::core::StringFormat;
pub use crate::parser::PdfVersion;
pub use crate::rendering::RenderOptions;
pub use crate::rendering::Renderer;
pub use crate::structure::Annotation;
pub use crate::structure::Metadata;
pub use crate::structure::Outline;
pub use crate::forms::FieldType;
pub use crate::forms::FormField;
pub use crate::fonts::cidfont::CidFont;
pub use crate::fonts::embedding::EmbeddedFont;
pub use crate::accessibility::validate_pdf_ua;
pub use crate::accessibility::AccessibilityCheck;
pub use crate::accessibility::AccessibilityReport;
pub use crate::accessibility::StructElem;
pub use crate::accessibility::StructTree;
pub use crate::standards::PdfALevel;
pub use crate::standards::PdfXLevel;
pub use crate::standards::StandardsCheck;
pub use crate::standards::StandardsReport;
pub use crate::signatures::SignatureInfo;
pub use crate::signatures::SignatureValidity;
pub use crate::signatures::SubFilter;

Modules§

accessibility
PDF accessibility and tagged PDF support.
content
Content stream processing.
core
Core PDF primitives and object model.
document
PDF Document: the high-level interface for reading PDF files.
encryption
PDF encryption and security handler support.
error
Error types for PDFPurr
fonts
Font handling for PDF text extraction.
forms
AcroForms support for PDF interactive forms.
images
PDF image extraction and representation.
ocr
OCR support for image-only PDF accessibility.
page_builder
High-level page builder for creating PDF pages with content.
parser
PDF parsing and lexical analysis.
rendering
PDF page rendering engine.
signatures
PDF digital signature support.
standards
PDF standards compliance validation.
structure
PDF document structure: outlines, annotations, and metadata.

Constants§

NAME
Library name
VERSION
Library version