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§
- Acro
Form Document - High-level wrapper for PDF documents with forms
- Form
Field - High-level representation of a form field
Enums§
- Field
Type - Field
Value - Represents a value that can be assigned to a form field
- PdfError
Traits§
- Field
Traversal - Trait for traversing form fields