Crate acroform

Crate acroform 

Source
Expand description

acroform - High-level PDF form manipulation library

This crate provides a simple, type-safe API for filling PDF forms. It wraps the low-level acroform-pdf crate with a high-level interface.

§Example

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

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

// List available fields
for field in doc.fields() {
    println!("{}: {:?}", field.name, field.field_type);
}

// Fill and save
let mut values = HashMap::new();
values.insert("name".to_string(), FieldValue::Text("John Doe".to_string()));
values.insert("agree".to_string(), FieldValue::Boolean(true));
doc.fill_and_save(values, "output.pdf")?;

Re-exports§

pub use acroform_pdf as pdf;

Structs§

AcroFormDocument
High-level wrapper for PDF documents with forms
FormField
High-level representation of a form field

Enums§

FieldType
FieldValue
Represents a value that can be assigned to a form field
PdfError

Traits§

FieldTraversal
Trait for traversing form fields