Crate acroform

Crate acroform 

Source
Expand description

§acroform

A high-level PDF form manipulation library using lopdf.

This crate provides a simple API for reading and filling PDF forms (AcroForms). It uses the official lopdf crate for PDF operations.

§Example

use acroform::{AcroFormDocument, FieldValue};
use std::collections::HashMap;

// Load a PDF with form fields
let mut doc = AcroFormDocument::from_pdf("form.pdf")?;

// List all fields
let fields = doc.fields()?;
for field in &fields {
    println!("Field: {} ({})", field.name, field.field_type);
}

// Fill fields
let mut values = HashMap::new();
values.insert("name".to_string(), FieldValue::Text("John Doe".to_string()));
values.insert("age".to_string(), FieldValue::Integer(30));

// Save filled PDF
doc.fill_and_save(values, "filled_form.pdf")?;

Structs§

AcroFormDocument
A PDF document with form fields
FormField
A form field in a PDF document

Enums§

Error
Error type for acroform operations
FieldType
PDF form field types
FieldValue
A typed value for a form field

Type Aliases§

Result
Result type alias for acroform operations