Mudrit
Reference

Signature Fields

list_signature_fields and SignatureField — discover the signature fields already present in a PDF

Part of mudrit-pdfsign

list_signature_fields enumerates the signature fields already in a PDF — empty slots and already-signed ones — to drive a UI, or to pick a named empty field for sign_existing_field. See Existing Fields & Seed Values for the walkthrough.

list_signature_fields

pub fn list_signature_fields(input: impl Into<PdfReader>) -> Result<Vec<SignatureField>>

Lists every AcroForm field with /FT /Sig in input, following the AcroForm /Fields array order.

use mudrit_pdfsign::list_signature_fields;

let pdf = std::fs::read("template.pdf").unwrap();
for f in list_signature_fields(pdf)? {
    println!("{} — page {} — {}", f.name, f.page, if f.signed { "signed" } else { "empty" });
}
# Ok::<(), mudrit_pdfsign::Error>(())

For an encrypted input, pass the open password on the PdfReader so the field names can be read: list_signature_fields(PdfReader::open("locked.pdf")?.password("asd")).

SignatureField

One signature field found in a PDF. Debug + Clone + PartialEq.

Prop

Type

Next

On this page