Bug 105579 - pdftocairo -pdf adds adds characters
Summary: pdftocairo -pdf adds adds characters
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: pdf backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Adrian Johnson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-18 17:37 UTC by Jason Crain
Modified: 2018-08-25 13:27 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
anonymized.pdf (28.03 KB, application/pdf)
2018-03-18 17:37 UTC, Jason Crain
Details
rendering of anonymized.pdf is good (2.24 KB, image/png)
2018-03-18 17:47 UTC, Jason Crain
Details
processed pdf from `pdftocairo -pdf` (7.97 KB, application/pdf)
2018-03-18 17:49 UTC, Jason Crain
Details
rendering or processed.pdf is bad (2.30 KB, image/png)
2018-03-18 17:51 UTC, Jason Crain
Details

Description Jason Crain 2018-03-18 17:37:51 UTC
Created attachment 138181 [details]
anonymized.pdf

I received a file from gour on the poppler IRC. With recent versions of cairo, printing with evince adds some characters to the document. I don't believe I'm allowed to share the original file so I'm attaching this anonymized version.

This is reproducible through poppler's pdftocairo program. Running `pdftocairo -pdf anonymized.pdf bad.pdf` produces a pdf that shows additional characters. I traced the regression to this commit:

commit 495362279b42620071c6b46f69918ce324aee0db (refs/bisect/bad)
Author: Adrian Johnson <ajohnson@redneon.com>
Date:   Sun Sep 27 08:27:53 2015 +0930

    scaled-font-subsets: if glyph 0 used for rendering, remap to different index

    Some broken pdfs use glyph 0 in embedded fonts for rendering instead of .notdef.
    The cmap we use for embedding latin fonts does not allow rendering glyph 0. Ensure
    if glyph 0 is used, it is mapped to a non 0 glyph in the subset.

    Bug 89082

This PDF includes a character mapped to glyph index 0. It's not supposed to be visible in the document, but after `pdftocairo -pdf` conversion it is.
Comment 1 Jason Crain 2018-03-18 17:47:38 UTC
Created attachment 138182 [details]
rendering of anonymized.pdf is good

Produced by `pdftocairo -png -singlefile anonymized.pdf good`. Rendering of anonymized.pdf, before processing by `pdftocairo -pdf`, is correct.
Comment 2 Jason Crain 2018-03-18 17:49:36 UTC
Created attachment 138183 [details]
processed pdf from `pdftocairo -pdf`

PDF created by `pdftocairo -pdf anonymized.pdf processed.pdf`. The conversion process adds a character to the document.
Comment 3 Jason Crain 2018-03-18 17:51:34 UTC
Created attachment 138184 [details]
rendering or processed.pdf is bad

Produced by `pdftocairo -png -singlefile processed.pdf bad`. Rendering of processed.pdf shows a new character in the image.
Comment 4 GitLab Migration User 2018-08-25 13:27:04 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/cairo/cairo/issues/13.


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.