Summary
Rendering any document with an active checkbox or radio button through poppler prints Syntax Error: Unknown font tag 'ZaDb' once per widget. The output itself is fine. mPDF writes /NeedAppearances true on the AcroForm, which tells viewers to regenerate field appearances, and poppler regenerates check-box appearances with the ZapfDingbats tag /ZaDb, which it then looks up in the form's default resources. mPDF's /DR only lists the document fonts, so the lookup fails and poppler warns.
Found while building the forms snapshot document for #38; harmless there, but it is noise in every pdftotext and pdftoppm run over a document with a checkbox, and any viewer that regenerates appearances the same way will draw the check with a fallback font. Same on gravitypdf.
Try it
$mpdf = new \Mpdf\Mpdf();
$mpdf->useActiveForms = true;
$mpdf->WriteHTML('<input type="checkbox" name="c" value="on" checked="checked" />');
$mpdf->Output('checkbox.pdf', 'F');
$ pdftotext checkbox.pdf /dev/null
Syntax Error: Unknown font tag 'ZaDb'
The file contains no ZaDb of its own: the widget's /DA names a document font and its /AP carries mPDF's own appearance streams; /DR is << /Font << /F1 ... >> >>.
Fix
Add a ZapfDingbats entry to the AcroForm default resources when the document has a checkbox or radio button, as Acrobat-generated forms do:
/DR << /Font << ... /ZaDb << /Type /Font /Subtype /Type1 /BaseFont /ZapfDingbats >> >> >>
Form::_putFormsCatalog() (or wherever /DR is written) already knows whether any button fields exist. Alternatively, write /NeedAppearances false when every field carries an appearance stream, which stops viewers regenerating in the first place; that is a broader change and worth checking against how text fields render in Acrobat.
Test plan
- A unit case asserting
/ZaDb appears in /DR when the document has a checkbox, and not otherwise.
pdftotext over tests/data/snapshots/page-break-avoid-forms.pdf printing nothing.
Summary
Rendering any document with an active checkbox or radio button through poppler prints
Syntax Error: Unknown font tag 'ZaDb'once per widget. The output itself is fine. mPDF writes/NeedAppearances trueon the AcroForm, which tells viewers to regenerate field appearances, and poppler regenerates check-box appearances with the ZapfDingbats tag/ZaDb, which it then looks up in the form's default resources. mPDF's/DRonly lists the document fonts, so the lookup fails and poppler warns.Found while building the forms snapshot document for #38; harmless there, but it is noise in every
pdftotextandpdftoppmrun over a document with a checkbox, and any viewer that regenerates appearances the same way will draw the check with a fallback font. Same ongravitypdf.Try it
The file contains no
ZaDbof its own: the widget's/DAnames a document font and its/APcarries mPDF's own appearance streams;/DRis<< /Font << /F1 ... >> >>.Fix
Add a ZapfDingbats entry to the AcroForm default resources when the document has a checkbox or radio button, as Acrobat-generated forms do:
Form::_putFormsCatalog()(or wherever/DRis written) already knows whether any button fields exist. Alternatively, write/NeedAppearances falsewhen every field carries an appearance stream, which stops viewers regenerating in the first place; that is a broader change and worth checking against how text fields render in Acrobat.Test plan
/ZaDbappears in/DRwhen the document has a checkbox, and not otherwise.pdftotextovertests/data/snapshots/page-break-avoid-forms.pdfprinting nothing.