Bug 99564

Summary: pdftops (checked 0.43.0 / 0.51.0) leads to unprintable ps for Lexmark E360d ("OFFENDING COMMAND: StartData")
Product: poppler Reporter: Paul Neuwirth <mail>
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: pdf file
postscript from pdftops -level3 (this one fails to be printed)
postscript from pdf2ps (uses gv) - printable
postscript from pdftops without -level3 - also printable
PS level 3, subsetted CID font
PS level 3, subsetted CID font, without line wraps
PS level 3, subsetted CID font, binary font data

Description Paul Neuwirth 2017-01-27 11:48:11 UTC
Created attachment 129176 [details]
pdf file

opensuse Leap 42.2
printing of textfiles stopped working since upgrade from cups 1.5 to cups 1.7.5.
traced down, poppler's pdftops causes the problem (old way gs pdf2ps succeeds).

Printer is a Lexmark e360d (old firmware AL.LB.E302'0 and also recent AL.LB.E302'0)

attached files:
pdf (created from /usr/lib/cups/filter/texttopdf) including embedded fonts 
ps output (created by pdftops -level3)
ps output (created by pdf2ps -dLanguageLevel3 (uses gv))
ps output (created by pdftops (without -level3))
the results of sending to printer:
# pdftops -level3 foomatic-LPuwPL 
# cat foomatic-LPuwPL.ps | nc printserver1.swabian.net 9902
@PJL USTATUS DEVICE
CODE=10023
DISPLAY="Belegt"
ONLINE=TRUE
%%[ Error: ioerror; Offending Command: StartData]%%
@PJL USTATUS DEVICE
CODE=10024
DISPLAY="Wartet"
ONLINE=TRUE
@PJL USTATUS DEVICE
CODE=10023
DISPLAY="Belegt"
ONLINE=TRUE
@PJL USTATUS DEVICE
CODE=10023
DISPLAY="Belegt"
ONLINE=TRUE
@PJL USTATUS DEVICE
CODE=10024
DISPLAY="Wartet"
ONLINE=TRUE()(0)alpha:/var/spool/cups/tmp 

Printer output:
"ERROR: ioerror
OFFENDING COMMAND: StartData

STACK

0
(
  8 ¢ Q < 6 n [ £ y l æ O , œ C v O " !5 ! !
)
arraytype"


# pdf2ps -dLanguageLevel=3 foomatic-LPuwPL
# cat foomatic-LPuwPL.ps | nc printserver1.swabian.net 9902
@PJL USTATUS DEVICE
CODE=10023
DISPLAY="Belegt"
ONLINE=TRUE
@PJL USTATUS DEVICE
CODE=10024
DISPLAY="Wartet"
ONLINE=TRUE
@PJL USTATUS DEVICE
CODE=10023
DISPLAY="Belegt"
ONLINE=TRUE

this one succeeds to print
pdftops (without -level3) also succeeds.

printing other pdfs and e.g. LibreOffice works.
Comment 1 Paul Neuwirth 2017-01-27 11:49:18 UTC
Created attachment 129177 [details]
postscript from pdftops -level3 (this one fails to be printed)
Comment 2 Paul Neuwirth 2017-01-27 11:50:23 UTC
Created attachment 129178 [details]
postscript from pdf2ps (uses gv) - printable
Comment 3 Paul Neuwirth 2017-01-27 11:51:04 UTC
Created attachment 129179 [details]
postscript from pdftops without -level3 - also printable
Comment 4 Paul Neuwirth 2017-01-27 11:56:35 UTC
info about poppler-tools used:
poppler-tools-0.51.0-2.1.x86_64 from https://build.opensuse.org/package/binaries/home:AndnoVember:LXQT/poppler?repository=openSUSE_Leap_42.2
and also from openSuSe main oss repository:
poppler-tools-0.43.0-1.3.x86_64 from https://build.opensuse.org/package/binaries/openSUSE:Leap:42.2/poppler?repository=standard
getting the same results
Comment 5 Albert Astals Cid 2017-01-29 17:02:17 UTC
Honestly i don't know a lot about ps but given gs likes the ps we create for that file (and doesn't output any warning), are you sure it's not a bug in the lexmark printer?
Comment 6 Paul Neuwirth 2017-02-02 10:22:26 UTC
Of course it could be a bug in the Lexmark printer (updated to latest firmware, previous firmware had the same issue). 
I don't know much over PS, so I hope someone could check the file for any obvious non-conforming content.
I first thought about a bug/issue with cups. I printed x thousands jobs without any problem using cups 1.5. Now with pdftops I have several issues, this one, and another, getting:
"ERROR:
configurationerror
OFFENDING COMMAND:
setpagedevice
STACK:
--nostringval--
false
847
604
0
0
847
604
--nostringval--
5"
Comment 7 Stefan Brüns 2018-05-15 02:46:32 UTC
@Paul:
1. Can you file another BR for the setpagedevice request, and attach a minimal PDF file generating the error, and also the generated PS from pdftops as well as the PPD, if possible.

2. Regarding the font/StartData issue:

- Reading https://wwwimages2.adobe.com/content/dam/acom/en/devnet/font/pdfs/5014.CIDFont_Spec.pdf, the code in the generated PS looks fine
- ghostscript is happy with the code

Differences between the generated PS files:
- pdftops -level3 embeds the font as CIDType0 font
- pdftops -level2 embeds the font as non-CID Type1 font
- ghostscript (pdf2ps) embeds the font as Type3 font

CID keyed fonts are a PS 3 feature, especially useful for fonts with large character sets, like the used "SourceCodePro".

-> Libreoffice generated PDFs may be ok because you use only fonts with small numbers of glyphs
-> ... or Libreoffice subsets the font, so it can use a non-CID format

The culprit here seems to be the PS interpreter in your printer. Possible issues:
- it is not PS3 compliant
- it has problems with (Hex) encoded Glyph data (the data following the "StartData" procedure. (ioerror should only appear if there is some data which is not whitespace nor hex characters).

For the last two points can you please:
1. test the following command:
  echo "languagelevel ==" | nc -q 30 printserver1.swabian.net 9902
2. Test the 3 attached files if any prints correctly?
Comment 8 Stefan Brüns 2018-05-15 02:47:51 UTC
Created attachment 139572 [details]
PS level 3, subsetted CID font
Comment 9 Stefan Brüns 2018-05-15 02:48:36 UTC
Created attachment 139573 [details]
PS level 3, subsetted CID font, without line wraps
Comment 10 Stefan Brüns 2018-05-15 02:49:09 UTC
Created attachment 139574 [details]
PS level 3, subsetted CID font, binary font data
Comment 11 GitLab Migration User 2018-08-20 21:42:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/39.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.