Bug 48349 - Cairo 1.12.0 do funny pdf prints.
Summary: Cairo 1.12.0 do funny pdf prints.
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: 1.12.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-05 11:31 UTC by Alex
Modified: 2012-04-06 20:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Issue example. (10.17 KB, application/pdf)
2012-04-05 11:31 UTC, Alex
Details
The correct print. (31.58 KB, application/pdf)
2012-04-05 13:07 UTC, Alex
Details
Created by pdflatex (31.58 KB, application/unknown)
2012-04-05 15:46 UTC, Alex
Details
Printed from lipsum.pdf (using evince - maybe a Evince bug?) (10.17 KB, application/unknown)
2012-04-05 15:47 UTC, Alex
Details
Printed from lipsum.pdf (using command line) (13.18 KB, application/unknown)
2012-04-05 15:48 UTC, Alex
Details
Printed from lipsum.pdf (using command line) (129.28 KB, application/postscript)
2012-04-05 15:48 UTC, Alex
Details
Printed from printed_lipsum.ps (using Evince) (93.47 KB, application/unknown)
2012-04-05 16:06 UTC, Alex
Details
Printed now. (187.68 KB, application/unknown)
2012-04-05 20:23 UTC, Alex
Details
Created with LibreOffice pdf export. (19.32 KB, application/unknown)
2012-04-05 20:41 UTC, Alex
Details
Original pdf imported with Inkscape and after printed with cups-pdf. (18.83 KB, application/unknown)
2012-04-05 20:44 UTC, Alex
Details
Evince print to a file (pdf) (10.95 KB, application/unknown)
2012-04-05 21:01 UTC, Alex
Details
Evince print to a file (ps) (28.62 KB, application/postscript)
2012-04-05 21:01 UTC, Alex
Details
Printed using cups-pdf. (945.85 KB, application/unknown)
2012-04-05 21:17 UTC, Alex
Details
Evince using print to a file. (922.33 KB, application/unknown)
2012-04-05 21:18 UTC, Alex
Details
Evince using print to a file. (1.81 MB, application/postscript)
2012-04-05 21:19 UTC, Alex
Details
Using cairo (ps). (1.50 MB, application/postscript)
2012-04-05 21:44 UTC, Alex
Details
Using cairo (pdf). (661.35 KB, application/unknown)
2012-04-05 21:45 UTC, Alex
Details
Using cups-pdf. (2.21 MB, application/unknown)
2012-04-05 21:52 UTC, Alex
Details
Original from pdflatex. (75.64 KB, application/unknown)
2012-04-06 11:15 UTC, Alex
Details
Printed by cups-pdf. (176.50 KB, application/unknown)
2012-04-06 11:16 UTC, Alex
Details
Evince print to a file (pdf) (98.79 KB, application/unknown)
2012-04-06 11:17 UTC, Alex
Details
Evince print to a file (ps) (884.52 KB, application/postscript)
2012-04-06 11:18 UTC, Alex
Details

Description Alex 2012-04-05 11:31:15 UTC
Created attachment 59531 [details]
Issue example.

Using Cairo 1.12.0 on Arch Linux x86-64, the prints from a pdf archive, specially from a LaTeX created pdf (pdflatex, pdftex, etc.), are funny.

https://bugs.archlinux.org/task/29295?project=1&string=cairo

Attached a example.
Comment 1 Uli Schlachter 2012-04-05 12:13:39 UTC
What exactly does "funny" mean? I did not laugh.
I didn't try to print this either, but just opening it in a PDF viewer I get "character soup". What should this look like?
Comment 2 Alex 2012-04-05 12:23:36 UTC
The print will be exactly as the pdf example. The result are the same "character soup" using cups-pdf printer and phisical a printer.
Comment 3 Alex 2012-04-05 12:28:08 UTC
(In reply to comment #1)
> What exactly does "funny" mean? I did not laugh.

In this case 'funny' means odd.
Comment 4 Uli Schlachter 2012-04-05 12:56:49 UTC
So... The PDF print just fine and the result is the same thing that is visible on screen? What you see is what you get?

What's the bug then?
Comment 5 Alex 2012-04-05 13:07:42 UTC
Created attachment 59534 [details]
The correct print.
Comment 6 Alex 2012-04-05 13:09:40 UTC
(In reply to comment #5)
> Created attachment 59534 [details]
> The correct print.

The bug is exactly the "character soup" when printing.
Comment 7 Alex 2012-04-05 13:16:39 UTC
Sorry, I should also have attached the corrects one at the first time.
Comment 8 Adrian Johnson 2012-04-05 14:50:17 UTC
Could you tell me how to reproduce the bug. The first pdf you attach was produced by ghostscript, not cairo. Assuming you are using gtk, print to a file in both PS and PDF format it check if it is correct.
Comment 9 Alex 2012-04-05 15:45:34 UTC
The first pdf I created printing the original pdf (the second attached).
Yes, I'm using gtk (Gnome 3.4)
_________________________________________________

How to reproduce the bug: (using Arch Linux - testing)

1- Take some pdf made using LaTeX;
2- Print the PDF with cairo-1.12.0 installed;
3- Get the "character soup".


Another way:

1- Take some pdf made using LaTeX;
2- Print the PDF with cairo-1.10.2 installed;
3- Get the correct print.
___________________________________________________

Attachements:

lipsum.pdf - Made by pdflatex command
printed_lipsum.pdf - printed from lipsum.pdf (using evince - maybe a Evince bug?)
printed2_lipsum.pdf - printed from lipsum.pdf (using command line)
printed_lipsum.ps - printed from lipsum.pdf (using command line)
Comment 10 Alex 2012-04-05 15:46:20 UTC
Created attachment 59547 [details]
Created by pdflatex
Comment 11 Alex 2012-04-05 15:47:14 UTC
Created attachment 59548 [details]
Printed from lipsum.pdf (using evince - maybe a Evince bug?)
Comment 12 Alex 2012-04-05 15:48:00 UTC
Created attachment 59549 [details]
Printed from lipsum.pdf (using command line)
Comment 13 Alex 2012-04-05 15:48:46 UTC
Created attachment 59550 [details]
Printed from lipsum.pdf (using command line)
Comment 14 Alex 2012-04-05 16:06:31 UTC
Created attachment 59551 [details]
Printed from printed_lipsum.ps (using Evince)

I did forget this.
Comment 15 Adrian Johnson 2012-04-05 16:50:28 UTC
Fixed with this commit:

http://cgit.freedesktop.org/cairo/commit/?id=70b2856ed3d31b41e69b3d82fb9c5c11c2b3d3d4
Comment 16 Alex 2012-04-05 16:55:55 UTC
Thanks!!! Compiling git version... Now!
Comment 17 Alex 2012-04-05 19:51:00 UTC
Unfortunately, until this commit

http://cgit.freedesktop.org/cairo/commit/?id=8886220b5027296f5b3b95e9c2f93509108d3b9e

not fixed here. Exactly same issue.

Using git version.
Comment 18 Adrian Johnson 2012-04-05 20:08:36 UTC
Are you saying it is not working with git master or it was working and the last commit broke it?

Can you attach the pdf output when using git master.
Comment 19 Alex 2012-04-05 20:22:25 UTC
I compiled for each at last three commits updates, and none of that solved the issue here.
Comment 20 Alex 2012-04-05 20:23:09 UTC
Created attachment 59558 [details]
Printed now.
Comment 21 Adrian Johnson 2012-04-05 20:32:28 UTC
(In reply to comment #20)
> Created attachment 59558 [details]
> Printed now.

This file was created by ghostscript. Does the cairo pdf and ps output work correctly?
Comment 22 Alex 2012-04-05 20:41:14 UTC
Created attachment 59560 [details]
Created with LibreOffice pdf export.

I don't know how to create a pdf/ps file directly using Cairo. So, I created with Libreoffice pdf export now.
Comment 23 Alex 2012-04-05 20:44:41 UTC
Created attachment 59561 [details]
Original pdf imported with Inkscape and after printed with cups-pdf.
Comment 24 Adrian Johnson 2012-04-05 20:54:27 UTC
Open the original pdf in evince then print to a file. The pdf output will be produced by cairo (you can check with pdfinfo or file->properties in evince).

Evince uses cairo to generate PS/PDF output. If you print to CUPS-PDF the cairo PS output is converted to PDF by ghostscript. In this case it is not possible to determine whether the bug is in cairo or ghostscript. Also you will get better quality pdf output by using print to file. The text in the CUPS-PDF output can not be copied and pasted.
Comment 25 Adrian Johnson 2012-04-05 20:57:00 UTC
The last three attachments do not have the very large glyph spacing so I'm not sure why you are still seeing the problem. Although the inkscape pdf output has a small issue with the the glyph spacing but this could be a limitation of the pdf import.
Comment 26 Alex 2012-04-05 21:01:05 UTC
Created attachment 59562 [details]
Evince print to a file (pdf)
Comment 27 Alex 2012-04-05 21:01:55 UTC
Created attachment 59563 [details]
Evince print to a file (ps)
Comment 28 Alex 2012-04-05 21:04:21 UTC
How can I help to grow the glyph spacing?
Comment 29 Adrian Johnson 2012-04-05 21:08:51 UTC
(In reply to comment #28)
> How can I help to grow the glyph spacing?

The glyph spacing looks to same as the pdflatex PDF. If you want to increase the glyph spacing you will need to do that from within pdflatex. Once printed to PDF the layout is fixed.
Comment 30 Alex 2012-04-05 21:16:26 UTC
I don't know if it help, but I make a test using my master dissertation and printing with cups-pdf or cairo the issue doesn't happens.
Comment 31 Alex 2012-04-05 21:17:17 UTC
Created attachment 59564 [details]
Printed using cups-pdf.
Comment 32 Alex 2012-04-05 21:18:22 UTC
Created attachment 59565 [details]
Evince using print to a file.
Comment 33 Alex 2012-04-05 21:19:58 UTC
Created attachment 59566 [details]
Evince using print to a file.

These lasts are a little big files.
Comment 34 Adrian Johnson 2012-04-05 21:22:24 UTC
(In reply to comment #30)
> I don't know if it help, but I make a test using my master dissertation and
> printing with cups-pdf or cairo the issue doesn't happens.

So the bug has been fixed? Or is there still a problem?
Comment 35 Alex 2012-04-05 21:27:37 UTC
     Well, the dissertation prints perfect but others not. I'm thinking the issue is only with one(some) font(s). The issue ever happens when using "latin modern" (lmodern) font (not used in dissertation), but it is the default in latex.
     I'll try with a big document using latin modern font to see if it will happens.
Comment 36 Adrian Johnson 2012-04-05 21:34:03 UTC
Could you attach a pdf that doesn't work.

You can also use pdftocairo to simplify testing. It is a poppler utility that outputs directly to cairo.

eg to print to ps:

pdftocairo -ps pdffile.pdf output.ps

to print to pdf:

pdftocairo -pdf pdffile.pdf output.pdf
Comment 37 Alex 2012-04-05 21:40:51 UTC
Thank you for the tip, really easily on this way!

From cups-pdf the issue happens. (it's seems very slow to print)

From Cairo pdf/ps perfect.

Attaching...
Comment 38 Alex 2012-04-05 21:44:15 UTC
Created attachment 59569 [details]
Using cairo (ps).
Comment 39 Alex 2012-04-05 21:45:44 UTC
Created attachment 59570 [details]
Using cairo (pdf).

I need to reduce the document, the cups-pdf output is going to 4.5MB.
Comment 40 Adrian Johnson 2012-04-05 21:46:47 UTC
You can use the -f and -l last options with pdftocairo to select a range of pages.
Comment 41 Alex 2012-04-05 21:52:21 UTC
Created attachment 59571 [details]
Using cups-pdf.

The issue happens.
Only the cups-pdf version goes bigger in MBs.
Comment 42 Adrian Johnson 2012-04-05 21:57:04 UTC
(In reply to comment #37)
> Thank you for the tip, really easily on this way!
> 
> From cups-pdf the issue happens. (it's seems very slow to print)
> 
> From Cairo pdf/ps perfect.
> 
> Attaching...

If the cairo output is correct but the cups-pdf output wrong the bug is in cups-pdf.
Comment 43 Alex 2012-04-05 22:00:09 UTC
Thank you for your time.
I'll report to cups-pdf upstream now.
Comment 44 James Cloos 2012-04-06 10:52:33 UTC
> From cups-pdf the issue happens. (it's seems very slow to print)

Based on the earlier comments on this thread, the cups-pdf likely
involves transparancy.

I suspect your cups filter chain first converts to postscript, uses
the pstops filter to set various options as per the ppd, and then
sends that ps to ghostscript’s pdfwriter DEVICE.  The conversion to
postscript step necessarily involves rasterizing any sections which
include transparancy to a pixmap.  It may do any page rather than
just any block.

In general, it is best to avoid cups-pdf if the program from which
you are printing has a print-to-file option.

Separately, the fact the evince re-generates a file for print rather
than passing the original document to the print flow is its own bug.
But one that they have refused to fix in the past.

Since the fonts might be an issue, does your ΤεΧ install use the type1
or the otf version of Latin Modern?  LM has more built-in leading than
most (Free) fonts; that may be related.
Comment 45 Alex 2012-04-06 11:13:46 UTC
I use type1 fonts in latex.

Since you talked about filters, I removed the "cups-filters-1.0.11" package and reinstall cups and foomatic*. Now every seems perfect.

So, the bug seems to be in cups-filters.

I'll attach the new results.
Comment 46 Alex 2012-04-06 11:15:58 UTC
Created attachment 59596 [details]
Original from pdflatex.
Comment 47 Alex 2012-04-06 11:16:34 UTC
Created attachment 59597 [details]
Printed by cups-pdf.
Comment 48 Alex 2012-04-06 11:17:28 UTC
Created attachment 59598 [details]
Evince print to a file (pdf)
Comment 49 Alex 2012-04-06 11:18:51 UTC
Created attachment 59599 [details]
Evince print to a file (ps)
Comment 50 Alex 2012-04-06 20:12:29 UTC
Really sorry, I did the last tests with cairo-1.10.2. So, all is the same as before. But I found a workaround. If I take the original file and use 'print to a file' postscript (pdf not work) and after I print (using cups-pdf or phisical printer) it's just works.
Also, I found the same issue using phisical printer, but I have no reliable ink amount now (only monday I will receive a new one).

In this case, I think this issue is a cups bug and not a cups-pdf specific bug.

I'll wait to the next monday to test with reliable amount of ink in the printer, and if I confirm the same issue using a phisical printer, I will report to cups upstream.

Thanks!


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.