Check PDFs against PDF/A, PDF/UA, and PDF/X standards. Get machine-readable violation reports. Enforce standards in CI/CD pipelines and batch workflows.
use pdfluent::{PdfDocument, PdfAProfile};
fn main() -> pdfluent::Result<()> {
let doc = PdfDocument::open("document.pdf")?;
let report = doc.validate_pdfa(PdfAProfile::A2b)?;
if report.is_compliant() {
println!("PDF/A-2b compliant");
} else {
for v in &report.violations {
println!("[{}] {}", v.rule, v.message);
}
}
Ok(())
}Run cargo add [email protected] to get started.
Validate long-term archival compliance at all three PDF/A conformance levels. PDFluent checks font embedding, color spaces, metadata, encryption restrictions, and all other clauses defined in ISO 19005.
Validate against the PDF/UA-1 standard (ISO 14289-1). Checks cover tag structure, alternative text, reading order, language declarations, and accessible table markup required by government and public-sector documents.
Validate print-production PDFs against ISO 15930. Checks enforce output intent, color management, bleed and trim boxes, and the prohibition of transparency in PDF/X-3.
Every validation returns a typed report with violation severity, affected object references, ISO clause numbers, and human-readable messages. Serialize to JSON for downstream processing or audit trails.
Run validation across thousands of documents in parallel using Rayon. PDFluent validators are Send + Sync and require no shared mutable state, making parallel batch jobs straightforward.
Exit with a non-zero status code when violations are found. Integrate validation as a gate in GitHub Actions, GitLab CI, or any pipeline that processes PDF output from a generation step.