pdftopdf exits with status 1 (no error message) on PDFs with form fields lacking /N and /BBox
Summary
pdftopdf terminates with exit status 1 when processing a PDF that contains
AcroForm fields whose appearance streams are missing the required /N entry
and /BBox. It emits only warnings, never an error, and gives no indication
that it is about to fail. The next filter in the chain (ghostscript) receives
an empty stream, reports "Input is empty, outputting empty file" and exits 0.
The job then fails with the generic message universal filter failed., which
points at the wrong component and makes the cause very hard to locate.
The same PDF prints fine after being rewritten by Ghostscript with
-dShowAnnots=false.
Versions
| Package |
Version |
| libcupsfilters |
2.2.1 |
| cups-filters |
2.0.1 |
| libppd |
2.1.1 |
| cups |
2.4.19 |
| ghostscript |
10.07.1 |
| Distribution |
Artix Linux (Arch-based, rolling) |
Printer: HP Smart Tank 7000 series, USB, hpcups driver with PPD.
The printer itself is not relevant — the failure happens before any
printer-specific filter is reached.
Steps to reproduce
Invoke the filter chain manually on an affected PDF:
sudo env \
PPD=/etc/cups/ppd/HP-Smart-Tank-7000-series.ppd \
CONTENT_TYPE=application/pdf \
FINAL_CONTENT_TYPE=application/vnd.cups-raster \
CUPS_DATADIR=/usr/share/cups \
CUPS_SERVERBIN=/usr/lib/cups \
/usr/lib/cups/filter/universal 1 user test 1 "" affected.pdf > /dev/null
Actual output
Abbreviated; the annotation block repeats once per form field:
DEBUG: page 1: Contains annotations
DEBUG: Opening field stream 1/4... with obj number 17
Key 'N' not found.
WARNING: Appearance stream is missing required /BBox.
DEBUG: special case ignore annotation with no appearance
...
DEBUG: Opening content stream 1/1...
DEBUG: Opened stream 1, resmap[1]=(nil)
DEBUG: cfFilterChain: pdftopdf completed with status 1.
DEBUG: cfFilterGhostscript: Input is empty, outputting empty file.
DEBUG: cfFilterChain: ghostscript completed with status 0.
ERROR: cfFilterChain: pdftopdf (PID 7025) stopped with status 1
INFO: cfFilterChain: ghostscript (PID 7026) exited with no errors.
ERROR: universal filter failed.
Note that pdftopdf walks both pages to completion and handles every
annotation via the "special case ignore annotation with no appearance"
path, so the failure does not appear to happen at the point where the
malformed annotations are encountered.
Expected behaviour
Either process the document (the malformed annotations are already being
skipped) or fail with a message that names the problem. The current
behaviour produces a misleading error that attributes the failure to the
universal filter.
Additional observations
- A minimal PDF generated with
gs -sDEVICE=pdfwrite passes through the
same chain without any problem, so the chain itself is intact.
- Rewriting the file with
gs -sDEVICE=pdfwrite -dPrinted=false -dShowAnnots=false makes it print
normally. This is what I am currently using as a workaround.
qpdf --flatten-annotations=all does not help — qpdf exits without
complaint but the malformed appearance streams survive and pdftopdf
still fails.
- The failure is independent of the print path: it occurs identically via
lp, via a PPD-based queue and via a driverless everywhere queue
(the printer does not accept application/pdf, so PDF conversion runs
in that case too).
- Job options make no difference; the failure reproduces with an empty
option string.
Possible regression
Printing these documents worked on this machine before libcupsfilters was
upgraded from 2.1.1 to 2.2.1. No other component of the print stack changed
in the relevant time window (ghostscript, poppler, cups and cups-filters
were all older than the last known-good print).
I have not verified this by downgrading, so please treat the regression
claim as circumstantial rather than confirmed.
Sample file
The document that triggered this is a personal order confirmation, so I
cannot attach it. Any PDF with AcroForm fields whose appearance streams
lack /N and /BBox should reproduce the issue; the warnings quoted
above are the reliable indicator in the log.
pdftopdf exits with status 1 (no error message) on PDFs with form fields lacking /N and /BBox
Summary
pdftopdfterminates with exit status 1 when processing a PDF that containsAcroForm fields whose appearance streams are missing the required
/Nentryand
/BBox. It emits only warnings, never an error, and gives no indicationthat it is about to fail. The next filter in the chain (ghostscript) receives
an empty stream, reports "Input is empty, outputting empty file" and exits 0.
The job then fails with the generic message
universal filter failed., whichpoints at the wrong component and makes the cause very hard to locate.
The same PDF prints fine after being rewritten by Ghostscript with
-dShowAnnots=false.Versions
Printer: HP Smart Tank 7000 series, USB,
hpcupsdriver with PPD.The printer itself is not relevant — the failure happens before any
printer-specific filter is reached.
Steps to reproduce
Invoke the filter chain manually on an affected PDF:
Actual output
Abbreviated; the annotation block repeats once per form field:
Note that
pdftopdfwalks both pages to completion and handles everyannotation via the "special case ignore annotation with no appearance"
path, so the failure does not appear to happen at the point where the
malformed annotations are encountered.
Expected behaviour
Either process the document (the malformed annotations are already being
skipped) or fail with a message that names the problem. The current
behaviour produces a misleading error that attributes the failure to the
universalfilter.Additional observations
gs -sDEVICE=pdfwritepasses through thesame chain without any problem, so the chain itself is intact.
gs -sDEVICE=pdfwrite -dPrinted=false -dShowAnnots=falsemakes it printnormally. This is what I am currently using as a workaround.
qpdf --flatten-annotations=alldoes not help — qpdf exits withoutcomplaint but the malformed appearance streams survive and
pdftopdfstill fails.
lp, via a PPD-based queue and via a driverlesseverywherequeue(the printer does not accept
application/pdf, so PDF conversion runsin that case too).
option string.
Possible regression
Printing these documents worked on this machine before libcupsfilters was
upgraded from 2.1.1 to 2.2.1. No other component of the print stack changed
in the relevant time window (ghostscript, poppler, cups and cups-filters
were all older than the last known-good print).
I have not verified this by downgrading, so please treat the regression
claim as circumstantial rather than confirmed.
Sample file
The document that triggered this is a personal order confirmation, so I
cannot attach it. Any PDF with AcroForm fields whose appearance streams
lack
/Nand/BBoxshould reproduce the issue; the warnings quotedabove are the reliable indicator in the log.