Crate oxidize_pdf

Source
Expand description

§oxidize-pdf

A pure Rust PDF generation and manipulation library with zero external PDF dependencies.

§Features

  • PDF Generation: Create multi-page documents with text, graphics, and images
  • PDF Parsing: Read and extract content from existing PDFs
  • PDF Operations: Split, merge, and rotate PDFs
  • Pure Rust: No C dependencies or external libraries

§Quick Start

use oxidize_pdf::{Document, Page, Font, Color, Result};
 
// Create a new document
let mut doc = Document::new();
doc.set_title("My PDF");
 
// Create a page
let mut page = Page::a4();
 
// Add text
page.text()
    .set_font(Font::Helvetica, 24.0)
    .at(50.0, 700.0)
    .write("Hello, PDF!")?;
 
// Add graphics
page.graphics()
    .set_fill_color(Color::rgb(0.0, 0.5, 1.0))
    .circle(300.0, 400.0, 50.0)
    .fill();
 
// Save the document
doc.add_page(page);
doc.save("output.pdf")?;

§Modules

  • document - PDF document creation and management
  • page - Page creation and layout
  • graphics - Vector graphics and images
  • text - Text rendering and flow
  • parser - PDF parsing and reading
  • operations - PDF manipulation (split, merge, rotate)

Re-exports§

pub use document::Document;
pub use document::DocumentMetadata;
pub use error::PdfError;
pub use error::Result;
pub use graphics::Color;
pub use graphics::GraphicsContext;
pub use graphics::Image;
pub use graphics::ImageFormat;
pub use graphics::ImageColorSpace;
pub use page::Page;
pub use page::Margins;
pub use parser::PdfReader;
pub use text::Font;
pub use text::FontFamily;
pub use text::TextContext;
pub use text::TextAlign;
pub use text::TextFlowContext;
pub use text::measure_text;
pub use text::split_into_words;

Modules§

document
error
graphics
objects
operations
PDF operations module
page
parser
PDF Parser Module
text
writer