use case
Government-style form filling
Programmatic form filling with schema validation.
Tax forms, visa applications, benefits claims. SnapPDF fills the original PDF (no re-drawing), validates field names, and returns the diff so nothing gets missed.
Operations used
/fill-form
Fill by AcroForm field name
/extract-text
Verify filled content
/sign
Applicant signature field
/protect
Lock before submission
Example workflow
- 01User completes form on your web UIYou already have their data.
- 02SnapPDF fill-formValues JSON → PDF fields by name.
- 03Diff unknown fieldsResponse lists `unknown` so you catch typos.
- 04SnapPDF signDraw the user’s captured signature.
- 05SnapPDF protect + downloadFinal artifact to download or file.
Code
const r = await snap.pdf.fillForm({
file: officialFormPdf,
values: userAnswers,
flatten: false, // keep editable for human review
});
if (r.unknown && r.unknown.length > 0) {
throw new Error(`Form schema changed — unknown fields: ${r.unknown.join(',')}`);
}Best for
Fintech KYCImmigration techGov-tech