Bug 719532

Summary: Tumbleweed: pdftops in Ghostscript < 9.05 results PS where black areas are not printed
Product: [openSUSE] openSUSE 11.4 Reporter: Roger Larsson <roger.larsson>
Component: PrintingAssignee: Johannes Meixner <jsmeix>
Status: RESOLVED FIXED QA Contact: Johannes Meixner <jsmeix>
Severity: Major    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.4   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: File that shows the problem
Greyscale scan of the output
output from cupsfilter
output from pdftops - directly printing gives erronous result

Description Roger Larsson 2011-09-21 15:54:14 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2

Can this be reproduced like bug #692356

Epson Photo RX620

Saw that there were some updates to Tumbleweed but none that looks related to printing...

Reproducible: Always

Steps to Reproduce:
1. lpr (the attached file)
2.
3.
Actual Results:  
Missing black rectangular areas (will add scan later)

Interesting: Now only blacks in the above picture was missing (looks like a outline with square inner sections not drawn black). Earlier attempts even the black in the below picture has been affected...

Expected Results:  
Solid black in black areas
Using okular and force rasterization works correct
Comment 1 Roger Larsson 2011-09-21 15:55:04 UTC
Created attachment 452267 [details]
File that shows the problem
Comment 2 Roger Larsson 2011-09-21 20:15:15 UTC
Created attachment 452323 [details]
Greyscale scan of the output
Comment 3 Johannes Meixner 2011-09-22 06:14:19 UTC
You mentioned bug #692356 which is about
wrong scaled characters but this bug #719532
seems to be a different issue.

Is it correct that you have "-dDisableFAPI=true" in
/usr/lib/cups/filter/pstoraster according to
https://bugzilla.novell.com/show_bug.cgi?id=692356#c17
but this does not help here?


Does it happen for black areas in any file format?

Does it also happen for black areas in PostScript files?
E.g. try /usr/share/ghostscript/9.00/examples/colorcir.ps

Does it happen for black areas only in any PDF file?

Does it happen for black areas only in particular PDF files?


You wrote "okular and force rasterization works".

Does printing the PDF from the Adobe Reader also work?
Comment 5 Roger Larsson 2011-11-19 00:23:50 UTC
Noticed today that I had got a response of this issue...
(Gutenprint 5.2.7-30.1-x86_64)

Yes, this is a different issue. But in bug #692356 you found a way to reproduce that problem without a printer... 

No -dDisableFAPI=true does not help.

Color circle prints OK
Converting the PDF to PS using pdf2ps (no options) works (prints OK)...!?
(Bug in builtin pdf to ps convertion?)

Do not print this kinds of documents often...

Acrobat Reader, works!
But using the command line that it says it uses does not...
(does it convert to ps before printing?)


lpr -P epsonstylusphotorx620 -o PageSize=A4 -o PageRegion=A4 -o ColorModel=RGB -o StpColorPrecision=Normal -o MediaType=Plain -o InputSlot=Standard -o StpQuality=Standard -o Resolution=361x360dpi -o OutputOrder=Reverse -o StpiShrinkOutput=Shrink -o StpCDInnerRadius=None -o StpInkSet=None -o StpFullBleed=False -o StpFeedSequence=None -o StpPrintingDirection=None -o StpWeave=None -o StpCDOuterDiameter=329 -o StpCDInnerDiameter=121 -o StpCDXAdjustment=0 -o StpCDYAdjustment=0 -o StpCDAllowOtherMedia=False -o StpInkType=None -o StpBandEnhancement=None -o StpColorCorrection=None -o StpBrightness=None -o StpFineBrightness=None -o StpContrast=None -o StpFineContrast=None -o StpSaturation=None -o StpFineSaturation=None -o StpImageType=TextGraphics -o StpCyanDensity=None -o StpFineCyanDensity=None -o StpMagentaDensity=None -o StpFineMagentaDensity=None -o StpYellowDensity=None -o StpFineYellowDensity=None -o StpBlackDensity=None -o StpFineBlackDensity=None -o StpDensity=None -o StpFineDensity=None -o StpDitherAlgorithm=None -o StpLinearContrast=False -o StpGamma=None -o StpFineGamma=None -o StpCyanGamma=None -o StpFineCyanGamma=None -o StpMagentaGamma=None -o StpFineMagentaGamma=None -o StpYellowGamma=None -o StpFineYellowGamma=None -o StpBlackGamma=None -o StpFineBlackGamma=None -o StpCyanBalance=None -o StpFineCyanBalance=None -o StpMagentaBalance=None -o StpFineMagentaBalance=None -o StpYellowBalance=None -o StpFineYellowBalance=None -o StpDropSize1=None -o StpFineDropSize1=None -o StpDropSize2=None -o StpFineDropSize2=None -o StpDropSize3=None -o StpFineDropSize3=None -o StpLightCyanValue=None -o StpFineLightCyanValue=None -o StpLightCyanTrans=None -o StpFineLightCyanTrans=None -o StpLightCyanScale=None -o StpFineLightCyanScale=None -o StpLightMagentaValue=None -o StpFineLightMagentaValue=None -o StpLightMagentaScale=None -o StpFineLightMagentaScale=None -o StpLightMagentaTrans=None -o StpFineLightMagentaTrans=None -o StpGray3Value=None -o StpFineGray3Value=None -o StpGray2Value=None -o StpFineGray2Value=None -o StpGray1Value=None -o StpFineGray1Value=None -o StpHGray5Value=None -o StpFineHGray5Value=None -o StpHGray5Trans=None -o StpFineHGray5Trans=None -o StpHGray5Scale=None -o StpFineHGray5Scale=None -o StpHGray4Value=None -o StpFineHGray4Value=None -o StpHGray4Trans=None -o StpFineHGray4Trans=None -o StpHGray4Scale=None -o StpFineHGray4Scale=None -o StpHGray3Value=None -o StpFineHGray3Value=None -o StpHGray3Trans=None -o StpFineHGray3Trans=None -o StpHGray3Scale=None -o StpFineHGray3Scale=None -o StpHGray2Value=None -o StpFineHGray2Value=None -o StpHGray2Trans=None -o StpFineHGray2Trans=None -o StpHGray2Scale=None -o StpFineHGray2Scale=None -o StpHGray1Value=None -o StpFineHGray1Value=None -o StpHGray1Trans=None -o StpFineHGray1Trans=None -o StpHGray1Scale=None -o StpFineHGray1Scale=None -o StpBlackTrans=None -o StpFineBlackTrans=None -o StpGCRLower=None -o StpFineGCRLower=None -o StpGCRUpper=None -o StpFineGCRUpper=None -o StpInkLimit=None -o StpFineInkLimit=None
Comment 6 Roger Larsson 2011-11-21 14:05:42 UTC
Got a clue!
Tried with all LanguageLevels for pdf2ps - all worked.
So how does CUPS do it?
Found cupsfilter
This postscript file gives the errounous result when printing
but looks OK when viewed in okular!

Two questions to investigate...
1) ps2ps - optimization stage?
2) Why do I get the DEBUG output?
   Have I modified some file in a way that it can't be updated
   Will investigate later.

# cupsfilter -m printer/foo HallowPrint.pdf > HallowPrint-cupsfilter.ps
DEBUG: argv[0]="cupsfilter"
DEBUG: argv[1]="1"
DEBUG: argv[2]="root"
DEBUG: argv[3]="HallowPrint.pdf"
DEBUG: argv[4]="1"
DEBUG: argv[5]=""
DEBUG: argv[6]="HallowPrint.pdf"
DEBUG: envp[0]="<CFProcessPath>"
DEBUG: envp[1]="CONTENT_TYPE=application/pdf"
DEBUG: envp[2]="CUPS_DATADIR=/usr/share/cups"
DEBUG: envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
DEBUG: envp[4]="CUPS_SERVERBIN=/usr/lib/cups"
DEBUG: envp[5]="CUPS_SERVERROOT=/etc/cups"
DEBUG: envp[6]="LANG=sv_SE.UTF8"
DEBUG: envp[7]="PATH=/usr/lib/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
DEBUG: envp[8]="PPD=/usr/share/cups/model/laserjet.ppd"
DEBUG: envp[9]="RIP_MAX_CACHE=256m"
DEBUG: envp[10]="USER=root"
INFO: pdftops (PID 2164) started.
DEBUG: Started filter pdftops (PID 2165)
DEBUG: Started filter pstops (PID 2166)
DEBUG: slow_collate=0, slow_duplex=0, slow_order=0
DEBUG: Before copy_comments - %!PS-Adobe-3.0
DEBUG: %!PS-Adobe-3.0
DEBUG: %%Creator: Writer
DEBUG: %%LanguageLevel: 2
DEBUG: %%DocumentSuppliedResources: (atend)
DEBUG: %%DocumentMedia: plain 595 842 0 () ()
DEBUG: %%BoundingBox: 0 0 595 842
DEBUG: %%Pages: 1
DEBUG: %%EndComments
DEBUG: Before copy_prolog - %%BeginDefaults
DEBUG: Before copy_setup - %%BeginSetup
DEBUG: Before page loop - %%Page: 1 1
DEBUG: Copying page 1...
PAGE: 1 1
DEBUG: pagew = 576.0, pagel = 720.0
DEBUG: bboxx = 0, bboxy = 0, bboxw = 612, bboxl = 792
DEBUG: PageLeft = 18.0, PageRight = 594.0
DEBUG: PageTop = 756.0, PageBottom = 36.0
DEBUG: PageWidth = 612.0, PageLength = 792.0
DEBUG: Wrote 1 pages...
DEBUG: PID 2165 (pdftops) exited with no errors.
DEBUG: PID 2166 (pstops) exited with no errors.
INFO: pdftops (PID 2164) exited with no errors.
Comment 7 Roger Larsson 2011-11-21 14:09:43 UTC
Created attachment 463174 [details]
output from cupsfilter

Oh, noted that cupsfilter uses 'pdftops' and not 'pdf2ps'... hmm...
Comment 8 Roger Larsson 2011-11-21 14:27:48 UTC
Created attachment 463177 [details]
output from pdftops - directly printing gives erronous result

Conversation to ps from pdf using pdftops gives errous prints!
But it looks correct in 'okular' 0.12.5 and
in 'gs' GPL Ghostscript  9.00 (2010-09-14)

> file HallowPrint.ps 
HallowPrint.ps: cannot open `HallowPrint.ps' (No such file or directory)
> pdftops HallowPrint.pdf 
> file HallowPrint.ps 
HallowPrint.ps: PostScript document text conforming DSC level 3.0, Level 2
> mv HallowPrint.ps HallowPrint-pdftops-PSLVL2.ps
> lpr HallowPrint-pdftops-PSLVL2.ps
> which pdftops
/usr/bin/pdftops
> /usr/bin/pdftops
pdftops version 0.14.4
> rpm -q -f /usr/bin/pdftops
poppler-tools-0.14.4-6.1.x86_64
Comment 9 Johannes Meixner 2011-11-22 10:21:11 UTC
When you print a PDF, the CUPS filtering system runs
first of all /usr/lib/cups/filter/pdftops which is only a wrapper
that calls /usr/bin/pdftops which actually converts PDF to PS.

/usr/bin/pdftops belongs to the poppler-tools RPM
and its package maintainer is Bin Li.

Perhaps the root cause is in /usr/bin/pdftops ?

Bin Li,
could you have a look at this issue to find out whether or not
the root cause is in pdftops that black areas are not printed
when the PostScript is made by pdftops from a PDF.


Roger Larsson,
when you print a PDF from the Adobe Reader, the Adobe Reader itself
converts the PDF to PS so that the Adobe Reader sends PS to CUPS.
Apparently the Adobe Reader PDF to PS conversion works best here
(it is known that often the Adobe Reader works best to print PDF)
to that at least for now you should use the Adobe Reader to print PDF
(regardless that the Adobe Reader is non-free software).

You may have a look at "Background Information" in
http://en.opensuse.org/SDB:How_to_Report_a_Printing_Issue
and for some more detail you may have a look at "The Filter" in
http://en.opensuse.org/SDB:CUPS_in_a_Nutshell

/usr/sbin/cupsfilter is a binary which does via commandline
the same as the CUPS filtering system does when printing,
see "man cupsfilter".
Comment 10 Roger Larsson 2011-11-22 12:01:21 UTC
Johannes Meixner, you might be a bit to fast to blame pdftops...

If I bring it up in 'okular' or 'gs' it views correctly.
So the output PS file might be OK - try to print it on a PS printer
or render it with pstopnm or to tiff
> cupsfilter -p ppd/epsonstylusphotorx620.ppd -m image/tiff /home/roger/Documents/OpenSuSE/BUGS/HallowPrint-pdftops-PSLVL2.ps > /home/roger/Documents/OpenSuSE/BUGS/HallowPrint-pdftops-PSLVL2-epson.tiff
This results in correct output.

I put most of the blame on the postscript renderer.
(pdftops uses some feature not used by pdf2ps thad does not render correctly)

Maybe even low level problem
 - might use some rectangle drawing ESC command not imlemented on my printer...
Comment 11 Johannes Meixner 2011-11-22 12:11:11 UTC
I do not blame pdftops - if I did, I would have re-assigned
the issue to the poppler-tools package maintainer.

I only asked the poppler-tools package maintainer for help
via "needinfo" - I humbly hope this is allowed.
Comment 12 Roger Larsson 2011-12-23 15:23:38 UTC
Any news on this issue - got hurt by it again today...
Comment 13 Johannes Meixner 2012-02-09 16:39:53 UTC
Roger Larsson,
if you like you may try out plain upstream Ghostscript 9.05
without any patch which is now available for testing (and only for testing)
in my openSUSE build service home project "home:jsmeix", see
https://bugzilla.novell.com/show_bug.cgi?id=735824#c28

Please read
https://build.opensuse.org/project/show?project=home%3Ajsmeix
Comment 14 Roger Larsson 2012-02-11 18:21:07 UTC
Yes!

So far so good - my pdf testfile now prints correctly.
Comment 15 Johannes Meixner 2012-02-14 08:37:24 UTC
Roger Larsson,
many thanks for testing it and for your feedback!

Let's continue Ghostscript issues in bug #735824