You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: flatten.js could throw a misleading error on PDFs with non-Latin field values
form.flatten() defaults to updateFieldAppearances:true, which regenerates
appearance streams (using WinAnsi-encoded Helvetica) for any field lacking
one -- including fields the user never touched, e.g. a PDF authored by
another tool that set field values but relied on NeedAppearances instead
of writing its own appearance streams. A non-Latin field value (CJK,
emoji, etc.) on such a field threw an uncaught WinAnsi encoding error,
shown as the generic 'may be corrupted or password-protected' fallback.
Pre-validate every field's own pre-existing value before calling flatten(),
same pattern as fill-form.js (#323) and watermark.js (#322).
`The value for "${fieldName}" has a character the form's font can't render (likely emoji, CJK, or another non-Latin script) — flattening would fail. Fix it in Fill Form first, or remove the field's value, and try again.`
0 commit comments