New issue
Advanced search Search tips

Issue 767343 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

OFFENDING COMMAND: setcachedevice

Reported by lains...@gmail.com, Sep 21 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36

Steps to reproduce the problem:
1. Go to any property page on Rightmove.com i.e. http://www.rightmove.co.uk/property-for-sale/property-68183540.html
2. Either Ctrl+P or "Print"
3. Print

What is the expected behavior?
Doc to print as normal

What went wrong?
Originally reported on wrong forum and advised to move here :)

Users (10+) are getting the following error when attempting to print a property from Rightmove.co.uk in Chrome. Error happening on 2nd page of print.I have replaced/updated printer driver. Works in IE and Firefox. Help!

Questions    Answers
Printer model:    Ricoh C3004 PS
Firmware version:    1.2.0.0
Connection:    Ethernet
Current OS:    Windows 7 x32
# of Machines Tried:    5+
# of Users Tried:    5+
Applications Tried:    Only in Chrome v60+
Error Messages:    
ERROR: undefined result
OFFENDING COMMAND: setcachedevice
Stack: 10 10 -10 -10 0 1 / .notdef -dictionary- -savelevel-
User environment: Both VMware and Local PC, issue on Win 7 x86, Win 7 x64 and Win 10 x64

This is only happening in v60 or above (I have tried canary aswell). Rolling back to v59 resolves the issue.

I have tried disabling Hardware acceleration. Using a different OS (Windows 10 x64). Reinstalling Chrome. 

Any more info needed please let me know :)

Also reported on https://forums.adobe.com/thread/2369540

Did this work before? Yes v59

Chrome version: 61.0.3163.91  Channel: stable
OS Version: 10.0
Flash Version: 

We have rolled back the enterprise to v59 as Rightmove is crucial to business. Causing issues with VMs now due to profile changing between the 2 versions
 
Components: Internals>Printing
Labels: Needs-Bisect Needs-Triage-M61
Owner: rbpotter@chromium.org
Status: Assigned (was: Unconfirmed)
I can see this command in output from postscript drivers when printing to file and reproduced this issue on Windows 10 with an HP postscript printer. Will look into what specifically is outputting that command.

In the meantime, you should be able to get this to work on the latest versions of Chrome by disabling postscript printing. Go to chrome://flags, look for "Disable PostScript Printing" and select "Enable". This will revert to using the printing path from v59, so spool sizes will be much larger but the bug with the "setcachedevice" command should not occur.
Labels: -Needs-Bisect
Doesn't need bisect as based on my testing this is happening in the new postscript printing path.

Comment 4 by lains...@gmail.com, Oct 6 2017

Hi rbpotter. Have you had any luck finding a fix for the next Chrome update?

Many thanks,
Stu
It appears that the bug is related to the fonts on this webpage, but we do not have a way to fix it yet and it generally takes a few cycles for any changes to reach stable Chrome. However, there is a workaround in place, see the flag described in comment 2. That flag restores the previous printing path, which sends the text as glyph drawings instead of as text and therefore avoids this problem.
Hi rbpotter,
Can you elaborate? What are the offending fonts? 
My company has encountered the same issue with the same error message.
Unfortunately I cannot provide a URL, as the pages that won't print are customer's online bills.
This looked like a font error since the problematic command is occurring when we try to load fonts and render text, but from what I can tell after a more detailed look it is specific not to the font itself but to the content. The example webpage gets transformed into a PDF that contains text elements that contain only a single space character, and transforming these elements to postscript seems to cause the error (at least on the HP printer I am testing with here). This is why the problem only occurs on certain pages. However, I am not sure what exactly in the page is causing these elements to be generated.

Working on determining how we want to fix this, will continue to update this bug.
Cc: thestig@chromium.org halcanary@chromium.org
Minimized test case based on the example webpage attached.

The issue appears to be the font-size: 0 CSS styling that is applied for printing by the page. cc halcanary@ - any ideas on what might be happening in Skia/Blink that would cause space text elements to be generated from something like this?
test_html.html
324 bytes View Download
test_styles.css
201 bytes View Download
I printed with "font-size: 0" to bad.pdf and without it to good.pdf. With both PDFs uncompressed, the bad vs good diff is:

 f
 0 0 0 RG 0 0 0 rg
 BT
-/F0 0 Tf
+/F0 16 Tf
 1 0 0 -1 137 94 Tm
 <0003> Tj
 ET
 1 1 0 RG 1 1 0 rg
-137 8 129 86 re
+141 8 129 86 re
 f
 Q
 Q

Both PDFs display fine, but in Evince, bad.pdf produces "font matrix not invertible" warnings. I haven't looked at the PDF to PS conversion, but I imagine that's what the printer dislikes. We probably should fix it 2 places:

1) PDFium's PS generator, since we don't always control the source PDF.
2) And in SkPDF, since it's not generating the best possible PDF. (See also  bug 775791  which I just filed.)
What does font-size:0 mean?  What do you want SkPDF to do?
Project Member

Comment 12 by bugdroid1@chromium.org, Oct 18 2017

The following revision refers to this bug:
  https://skia.googlesource.com/skia/+/29ebe7a80d7b8fa0b72d1d1fb5d8ace57a95b961

commit 29ebe7a80d7b8fa0b72d1d1fb5d8ace57a95b961
Author: Hal Canary <halcanary@google.com>
Date: Wed Oct 18 18:41:58 2017

SkPDF: TextSize > 0;

BUG= chromium:767343 
Change-Id: Ide85e82bfc53ef8cf5fb59d9c7733436f83d7209
Reviewed-on: https://skia-review.googlesource.com/61580
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

[modify] https://crrev.com/29ebe7a80d7b8fa0b72d1d1fb5d8ace57a95b961/src/pdf/SkPDFDevice.cpp

re: comment 10, I'm no CSS expert, but took the test example, stuck "hello world" insize the <div> with font-size:0 and it didn't change the on-screen output. So your SkPDF CL LGTM.
Hi there, we're getting the same error as above when printing the page from Google 60/61, we aren't converting it to PDF at all.
Re: comment 14, when you print the webpage, Chrome internally converts it to PDF then converts the PDF to either PostScript or EMF (if you have the "disable postscript printing" flag on, or the printer is not a PostScript printer). That's why there is discussion about conversion to PDF - comment 9 is saying we need to look at both the HTML -> PDF conversion and the subsequent PDF -> PS conversion to fix this bug.
Project Member

Comment 16 by bugdroid1@chromium.org, Oct 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b3a03f16a8014a85f050498c9f386cab781ea640

commit b3a03f16a8014a85f050498c9f386cab781ea640
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Thu Oct 19 01:55:15 2017

Roll src/third_party/skia/ c4f93cab6..eac03014e (22 commits)

https://skia.googlesource.com/skia.git/+log/c4f93cab667b..eac03014e564

$ git log c4f93cab6..eac03014e --date=short --no-merges --format='%ad %ae %s'
2017-10-18 reed fix mapRect to always return the same as rectStaysRect
2017-10-10 kjlubick Update to go 1.9
2017-10-18 bungeman Compute inverse gamma table at compile time.
2017-10-18 bsalomon Fix dirty rect used when updating GrRenderTarget after clearing as draw in GrGLGpu.
2017-10-18 scroggo Move SkCodec::Origin into its own file
2017-10-18 brianosman Remove color space xform from GrTextureDomain & GrSimpleTextureEffect
2017-10-18 mtklein fix libc++/MSAN instructions
2017-10-18 halcanary SkPDF: TextSize > 0;
2017-10-17 liyuqian Update MSAN gn args to match our bots
2017-10-18 benjaminwagner Revert "Add an Option for orientation on JPEG encodes"
2017-10-18 angle-deps-roller Roll skia/third_party/externals/angle2/ d042fba42..d0ef13a25 (1 commit)
2017-10-18 robertphillips Disable FullScreenClearWithLayers test on NexusPlayer Vulkan
2017-10-18 scroggo Add an Option for orientation on JPEG encodes
2017-10-18 csmartdalton Add a SampleApp flag to automate keystrokes on startup
2017-10-18 borenet bin/try: Add interactive mode
2017-10-18 herb Reland the combined 3 pass image blur with a fix to the bounds calculation
2017-10-17 mtklein Feed seed_shader() iota through a context pointer.
2017-10-18 caryclark convert mapHomogeneousPoints to SkPoint3
2017-10-17 mtklein rename (x,y) to (dx,dy)
2017-10-18 mtklein Revert "Remove some blur tests on google3 until the flag is removed."
2017-10-18 brianosman Convert more code to use color space xform FP
2017-10-18 brianosman Convert several effects to use color space xform FP

Created with:
  roll-dep src/third_party/skia
BUG= 767343 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=benjaminwagner@chromium.org

Change-Id: I152654c52c98c295a5ac2499ca86fa61d3c1f258
Reviewed-on: https://chromium-review.googlesource.com/726960
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509968}
[modify] https://crrev.com/b3a03f16a8014a85f050498c9f386cab781ea640/DEPS

Project Member

Comment 17 by bugdroid1@chromium.org, Oct 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3dbd4a4bba62a3e8d5b211c5dd7e4ffa8a5b07d8

commit 3dbd4a4bba62a3e8d5b211c5dd7e4ffa8a5b07d8
Author: skia-deps-roller@chromium.org <skia-deps-roller@chromium.org>
Date: Thu Oct 19 02:26:42 2017

Roll src/third_party/skia/ c4f93cab6..eac03014e (22 commits)

https://skia.googlesource.com/skia.git/+log/c4f93cab667b..eac03014e564

$ git log c4f93cab6..eac03014e --date=short --no-merges --format='%ad %ae %s'
2017-10-18 reed fix mapRect to always return the same as rectStaysRect
2017-10-10 kjlubick Update to go 1.9
2017-10-18 bungeman Compute inverse gamma table at compile time.
2017-10-18 bsalomon Fix dirty rect used when updating GrRenderTarget after clearing as draw in GrGLGpu.
2017-10-18 scroggo Move SkCodec::Origin into its own file
2017-10-18 brianosman Remove color space xform from GrTextureDomain & GrSimpleTextureEffect
2017-10-18 mtklein fix libc++/MSAN instructions
2017-10-18 halcanary SkPDF: TextSize > 0;
2017-10-17 liyuqian Update MSAN gn args to match our bots
2017-10-18 benjaminwagner Revert "Add an Option for orientation on JPEG encodes"
2017-10-18 angle-deps-roller Roll skia/third_party/externals/angle2/ d042fba42..d0ef13a25 (1 commit)
2017-10-18 robertphillips Disable FullScreenClearWithLayers test on NexusPlayer Vulkan
2017-10-18 scroggo Add an Option for orientation on JPEG encodes
2017-10-18 csmartdalton Add a SampleApp flag to automate keystrokes on startup
2017-10-18 borenet bin/try: Add interactive mode
2017-10-18 herb Reland the combined 3 pass image blur with a fix to the bounds calculation
2017-10-17 mtklein Feed seed_shader() iota through a context pointer.
2017-10-18 caryclark convert mapHomogeneousPoints to SkPoint3
2017-10-17 mtklein rename (x,y) to (dx,dy)
2017-10-18 mtklein Revert "Remove some blur tests on google3 until the flag is removed."
2017-10-18 brianosman Convert more code to use color space xform FP
2017-10-18 brianosman Convert several effects to use color space xform FP

Created with:
  roll-dep src/third_party/skia
BUG= 767343 


Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, see:
http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls


CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
TBR=benjaminwagner@chromium.org

Change-Id: I9cfe20dcfe44e37ab9d36b4e928b2297c0902dc2
Reviewed-on: https://chromium-review.googlesource.com/727265
Reviewed-by: Skia Deps Roller <skia-deps-roller@chromium.org>
Commit-Queue: Skia Deps Roller <skia-deps-roller@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509977}

Project Member

Comment 18 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/d0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da

commit d0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da
Author: rbpotter <rbpotter@chromium.org>
Date: Fri Oct 20 00:47:19 2017

PostScript: Do not send fonts with size <= 0 to printers

Bug:  chromium:767343 
Change-Id: I9321e7565feb423a1283c74e91297eeaeb80083f
Reviewed-on: https://pdfium-review.googlesource.com/16410
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>

[modify] https://crrev.com/d0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da/core/fxge/win32/cfx_psrenderer.cpp

The change from comment 12 has landed in Chrome Canary. This appears to fix the issue with the rightmove.co.uk example in the bug report when I print to an HP PostScript printer here - the full 5 pages print out and there is no "OFFENDING COMMAND" error message. Please test on Canary (version 64.0.3245.0 or higher) and see if this is also fixed with the printer you are using.

Note that the second change (from comment 18) is not in Canary yet - will update again when it is.
Labels: Needs-Feedback
Both changes should now be in Canary (64.0.3246.0 or higher) and the example page in the bug report is printing without errors on the PostScript printer we have here. Please test to see if it works for you and update if there are still any issues.
Labels: Merge-Request-63
Verified this locally and have received reports this is fixed. Requesting merge to M-63 since this prevents printing of certain webpages. We should only need to merge the Pdfium change (comment 18) as it will filter out font size 0 elements even if Skia adds them to the PDF.
Project Member

Comment 22 by sheriffbot@chromium.org, Oct 30 2017

Labels: -Merge-Request-63 Merge-Review-63 Hotlist-Merge-Review
This bug requires manual review: Reverts referenced in bugdroid comments after merge request.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), gkihumba@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-63 Merge-Approved-63
Approving merge for CL listed at #18 to M63 branch 3239 based on comment #21. Please merge ASAP so we can take it in for this week Beta release. Thank you.
Project Member

Comment 24 by bugdroid1@chromium.org, Oct 30 2017

Labels: -merge-approved-63 merge-merged-3239
The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/cd1fd6bc4343c303ee786983dc5dd41a2e0bc16c

commit cd1fd6bc4343c303ee786983dc5dd41a2e0bc16c
Author: Lei Zhang <thestig@chromium.org>
Date: Mon Oct 30 21:37:01 2017

M63: PostScript: Do not send fonts with size <= 0 to printers

Bug:  chromium:767343 
TBR=rbpotter@chromium.org

Change-Id: I9321e7565feb423a1283c74e91297eeaeb80083f
Reviewed-on: https://pdfium-review.googlesource.com/16410
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
(cherry picked from commit d0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da)
Reviewed-on: https://pdfium-review.googlesource.com/17170
Commit-Queue: Lei Zhang <thestig@chromium.org>

[modify] https://crrev.com/cd1fd6bc4343c303ee786983dc5dd41a2e0bc16c/core/fxge/win32/cfx_psrenderer.cpp

Status: Fixed (was: Assigned)
Marking this as fixed now that M63 is now the Stable channel. Please open a new bug if you see anything similar in M63+.
Project Member

Comment 26 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c8d6a20b06353e6b286d2ed2fa98d22ea94cda63

commit c8d6a20b06353e6b286d2ed2fa98d22ea94cda63
Author: Lei Zhang <thestig@chromium.org>
Date: Tue Apr 03 18:55:51 2018

Add regression test for  bug 767343 .

Make sure there is no text output when converting from PDF to PS for
text with size 0.

BUG= 767343 , 827748 

Change-Id: Id788b1f936d4f97b2201b7171a756a7ec2892bf1
Reviewed-on: https://chromium-review.googlesource.com/989299
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547779}
[modify] https://crrev.com/c8d6a20b06353e6b286d2ed2fa98d22ea94cda63/chrome/browser/printing/pdf_to_emf_converter_browsertest.cc
[add] https://crrev.com/c8d6a20b06353e6b286d2ed2fa98d22ea94cda63/chrome/test/data/printing/bug_767343.emf
[add] https://crrev.com/c8d6a20b06353e6b286d2ed2fa98d22ea94cda63/chrome/test/data/printing/bug_767343.pdf

Sign in to add a comment