New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 857074 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 15
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

[User Feedback - Stable] Print Preview does not work when Download PDF files is enabled

Project Member Reported by craigtumblison@chromium.org, Jun 27 2018

Issue description

Chrome Version: 66.0.3359.181, 67.0.3396.99
OS: Windows NT: 10.0.17134, Windows NT: 6.1.7601 SP1, Mac OSX

1. Enable "Download PDF files instead of automatically opening them in Chrome".
2. Try to print a document or page.
3. The print preview fails to load.

There's a community thread with screenshots here:
- https://productforums.google.com/forum/#!topic/chrome/KopvTAnAEUY

Listnr Reports:
- https://listnr.corp.google.com/report/85519347447
- https://listnr.corp.google.com/report/85515404282

Thanks!
 
Labels: Needs-Triage-M67
Cc: thestig@chromium.org weili@chromium.org
Components: Internals>Printing Internals>Plugins>PDF
Status: Untriaged (was: Unconfirmed)
I think I can repro on Linux ToT: with the setting to download PDF files enabled, when I try to print http://csreis.github.io/tests/cross-site-iframe.html, I see "Google Chrome cannot show the print preview while the built-in PDF viewer is disabled" in the print preview.  I checked whether this might be related to site isolation (via chrome://flags/#site-isolation-trial-opt-out) or PDF compositor service (via chrome://flags/#use-pdf-compositor-service-for-print), but this seems to repro independently of both.  Another thing I noticed is the first print preview fails, but after trying to print again, the second print preview succeeds.  +thestig@ and weili@ who might have ideas.
Labels: OS-Linux
That setting should not affect Print Preview, but here we are.
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Tried checking the issue on chrome version 67.0.3396.99 using Ubuntu 14.04 with the below mentioned steps.
1. Launched Chrome
2. Navigated to http://csreis.github.io/tests/cross-site-iframe.html
3. In Chrome://settings enabled "Download PDF files instead of automatically opening them in Chrome".
4. Tried printing the page/Print preview (...URL in point#2)
We were able to see the print preview with out any issues, tried by changing the option from "Save as PDF" to a destination printer, still we have seen the preview. Attaching the screen cast of the same for reference.
Note: Even by enabling/disabling the site-isolation flag we didn't observe any change.

Could someone have a look at the screen cast and let us know if we have missed anything in the process of reproducing the issue from our end. Any further inputs may be helpful.
857074.ogv
3.4 MB View Download
I can't reproduce this either, on Windows 10 (tried Beta, Canary, and Stable) or on Linux (tried Stable and ToT with & without the new print preview flag).
Cc: alex...@chromium.org
alexmos: I also can't repro. Can you list the steps you took to repro with a brand new profile?
Attached is a video showing how I can easily reproduce this issue.  Problem occurs in Windows and Mac.  Please advise.
ChromePrintPDF - Medium.mov
6.1 MB View Download
#6: I noticed I get the error only after a restart, and only for the very first print preview.  So, if I open http://csreis.github.io/tests/cross-site-iframe.html in one tab, open a second tab and go to chrome://restart, then ctrl-p on the first tab after restart, I see "Google Chrome cannot show the print preview while the built-in PDF viewer is disabled".  Second ctrl-p works.  This might be a different issue from #7 though, where no error is shown at all.
Still can't reproduce with restarting on Linux ToT or Windows Canary (69.0.3479.0). Comment 7 does look like a separate issue as it seems like Print Preview doesn't show up at all, and it may be specific to Google Docs/Sheets?
Cc: raymes@chromium.org
Tried again and got this to reproduce on ToT (still can't seem to get it to happen on Canary). The relevant code is here: https://cs.chromium.org/chromium/src/chrome/browser/resources/print_preview/previewarea/preview_area.js?l=423-433
It is duplicated in both versions of the Print Preview UI, so the same thing happens regardless of the new print preview flag.
cc-ing raymes@ who has a TODO listed there indicating that this check might not be the best way to verify the plugin - any idea what might be going on here?
Well that code is just trying to check if a plugin is available. Is the plugin actually available in print preview? It seems like it may not be.
Labels: -Needs-Feedback
Owner: rbpotter@chromium.org
Status: Assigned (was: Untriaged)
Mac triage: untagging Needs-Feedback since we got a dev repro and assigning to rbpotter@ for followup.
Owner: thestig@chromium.org
I can reproduce this by using chrome://restart.

re: comment 7 - when Google Sheets prints, it generates a PDF for printing. Normally that opens in a new Chrome tab and it uses Javascript to call window.print() to print the PDF. When "Download PDF files instead of automatically opening them in Chrome" is turned on, the PDF generated by Sheets gets downloaded. So that is working as expected. Open the downloaded PDF in your preferred PDF viewer and print it there.
When I can reproduce this bug, I need to trigger print preview as soon as a page loads at start up. At this point, the plugins haven't been fully loaded yet, so EnableInternalPDFPluginForContents() fails.
For comment 7, which is the "community thread with screenshots" case, I would refer to https://support.google.com/docs/answer/7663148 - when Download PDF files is enabled, Chrome behaves like Firefox or Safari. In which case, "a PDF file will automatically download. In your PDF viewer, go to File and then Print."

For the Listnr reports, it's not obvious the user in those reports have Download PDF enabled. Given that, I'll try to fix the one case I can reproduce. If other users are hitting this problem, but for different reasons, they'll need to file separate bug reports. We can investigate them on a case by case basis.
Project Member

Comment 16 by bugdroid1@chromium.org, Aug 15

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

commit e4e9c5536a4c0e9f981226b6188ec91bfa67e7a4
Author: Lei Zhang <thestig@chromium.org>
Date: Wed Aug 15 21:12:31 2018

Make Print Preview work correctly at early startup.

Print Preview needs the PDF plugin to work, but plugin loading happens
asynchronously at startup. So querying the PluginService with
GetPluginInfoByPath() may fail because the plugins have not been loaded
yet.

However, since the PDF plugin is a built-in PPAPI plugin, it does not
need to be loaded from disk asynchronously. Since it is already
registered, call GetRegisteredPpapiPluginInfo() instead.

BUG= 857074 

Change-Id: I729b40329f1de92da6789efbbbae7e2c09ab8b51
Reviewed-on: https://chromium-review.googlesource.com/1175553
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583392}
[modify] https://crrev.com/e4e9c5536a4c0e9f981226b6188ec91bfa67e7a4/chrome/browser/printing/print_view_manager.cc

Status: Fixed (was: Assigned)
Cc: krajshree@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on mac 10.13.3 using chrome reported version #67.0.3396.99 as per comment #0. Observed that print preview loaded without any issues.
Attached a screen cast for reference.

thestig@ - Could you please check the attached screen cast and please help us in verifying the fix.

Thanks...!!
857074.mp4
373 KB View Download

Sign in to add a comment