New issue
Advanced search Search tips

Issue 775205 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Broken glyphs in pdfs

Reported by jamiemmt...@gmail.com, Oct 16 2017

Issue description

Steps to reproduce

Tell us about your environment:
~> node --version
v8.7.0
~/node_modules/puppeteer> npm list
puppeteer@0.11.0 [...]/node_modules/puppeteer
├─┬ debug@2.6.9
│ └── ms@2.0.0

~> cat /etc/*-release
NAME="openSUSE Leap"
VERSION="42.2"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.2"
PRETTY_NAME="openSUSE Leap 42.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
openSUSE 42.2 (x86_64)
VERSION = 42.2
CODENAME = Malachite

Running the following code

https://pastebin.com/XPqCH1Ue

followed by the command

gs -sDEVICE=pdfwrite -dCompatibilityLeve=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=nyt.puppet.compressed.pdf nyt-pdf.pdf`

should produce a compressed PDF. Instead, there are a bunch of glyph errors:

GPL Ghostscript 9.15: ERROR: Page 0 used undefined glyph 'g1' from type 3 font 'PDFType3Untitled', key ''

https://pastebin.com/psiNigUX

I'm not sure exactly what's happening with the PDF rendering such that the fonts get screwy; the PDF looks fine, though it doesn't once it's compressed with GS ending in those errors. Both attached.


(Originally filed with Puppeteer crowd who sent me here, https://github.com/GoogleChrome/puppeteer/issues/1023#event-1293887794)
 
nyt.puppet.compressed.pdf
1.0 MB Download
nyt-pdf.pdf
3.1 MB Download
Labels: Needs-Triage-M61
Cc: thestig@chromium.org
Components: Internals>Plugins>PDF
Status: Available (was: Unconfirmed)
Labels: Needs-Feedback
I am not familiar with Node or Puppeteer. Can you better explain what the code does? Does it essentially launch Chromium in headless mode, load a webpage, and print it to PDF? With the bug being GhostScript is not happy with the resulting PDF? Is it possible to reduce the Puppeteer commands into a set of step one can take in the web browser manually?

Also, why was this filed as a Mac bug when the environment in question is Linux?
Yes, that is what this combination does. Opens a headless session, loads, and prints to pdf. It is not merely that GS isn't happy with the PDF, the rendering of the fonts on the pdf seems to be "buggy" insamuchas the headlines cannot be selected in the resulting PDF. If one prints via chromium directly, chromium prints using some other font (Times New Roman?) rather than rendering the text in its original font.

Not sure how to fix the OS on the ticket...


Labels: -OS-Mac OS-Linux
Components: -Internals>Plugins>PDF Internals>Skia>PDF
Labels: -Needs-Feedback
It looks like one can just visit the NY Times website, print preview, and Save to PDF. The website of course has changed slightly, but the output is still roughly 3.x MB. Running it through gs produces the same PDFType3Untitled messages for me.
Project Member

Comment 7 by sheriffbot@chromium.org, Oct 22

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment