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

Issue 800147 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

While saving a file (like .docx or image) as PDF, its filename contains original file extension.

Project Member Reported by mkarkada@chromium.org, Jan 9 2018

Issue description

Chrome OS: 10176.41.0, 64.0.3282.79 beta channel on caroline, eve devices.

What steps will reproduce the problem?
(1) Open Files app and open any .docx or .pptx or any image file.
(2) Select Print option and click on Save option to save the file in PDF format.
(3) In the "Save file as" dialog option, observe the highlighted portion in the filename field ( i.e. beside SAVE and CANCEL buttons).

What happens instead?
The highlighted text contains the original filename with its extension.
i.e. Clicking on SAVE button, causes the file to saved as PDF like eg.'filename.docx.pdf'

Please refer the screenshots for expected and actual behaviors.
 
Expected.png
236 KB View Download
Actual_1.png
281 KB View Download
Owner: fukino@chromium.org
Status: Assigned (was: Untriaged)
fukino@ - Could you take a look at this one for M64 please?
Cc: fukino@chromium.org
Components: -Platform>Apps>FileManager Internals>Printing UI>Browser>PrintPreview
Owner: thestig@chromium.org
Print preview decides the file names of generated PDF files.
thestig@, could you triage this one?
Did this regress? If not, it might be a bit late to fix this for M64.
i.e. Did Chrome 63 work ok? Maybe I caused this while trying to fix  bug 375330  and  bug 782041 .
Labels: OS-Linux OS-Mac OS-Windows
I bisected. It's r515276.
Project Member

Comment 6 by bugdroid1@chromium.org, Jan 12 2018

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

commit 950aafdb7eed0d5bfa02237e414fe4f73db713ad
Author: Lei Zhang <thestig@chromium.org>
Date: Fri Jan 12 20:47:08 2018

Add more PdfPrinterHandlerTests.

Expose tested logic as PdfPrinterHandler::GetFileName().

BUG= 800147 

Change-Id: I12d703b79cb89c8b9bbd48024f3647bdd7c04898
Reviewed-on: https://chromium-review.googlesource.com/861198
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529055}
[modify] https://crrev.com/950aafdb7eed0d5bfa02237e414fe4f73db713ad/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
[modify] https://crrev.com/950aafdb7eed0d5bfa02237e414fe4f73db713ad/chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
[modify] https://crrev.com/950aafdb7eed0d5bfa02237e414fe4f73db713ad/chrome/browser/ui/webui/print_preview/pdf_printer_handler_unittest.cc

Status: Started (was: Assigned)
I can fix the case of: file:///path/to/test.png. Currently in M64 it suggests something like "test.png (420×150).pdf" but in M63 it suggested test.pdf.

I can't actually fix the "filename.docx.pdf" case, because "filename.docx" is the title of the document and not the URL. We can't distinguish "filename.docx" from a title of "what does this even.mean" from  bug 375330 . The previous behavior just got lucky. Also, having "filename.docx.pdf" is consistent with the save dialog, which suggests "filename.docx.mhtml" for the same .docx file.
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 17 2018

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

commit f22c90913f3694c5963528f448d4a2325b29f414
Author: Lei Zhang <thestig@chromium.org>
Date: Wed Jan 17 00:51:21 2018

Make PdfPrinterHandler more consistent with downloads.

Offer better suggestions for file:///path/to/foo.png, and for webpages
without titles.

BUG= 800147 

Change-Id: I1ad39dd98376aac3e1772da79138c694903d8f93
Reviewed-on: https://chromium-review.googlesource.com/865941
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529532}
[modify] https://crrev.com/f22c90913f3694c5963528f448d4a2325b29f414/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
[modify] https://crrev.com/f22c90913f3694c5963528f448d4a2325b29f414/chrome/browser/ui/webui/print_preview/pdf_printer_handler.h
[modify] https://crrev.com/f22c90913f3694c5963528f448d4a2325b29f414/chrome/browser/ui/webui/print_preview/pdf_printer_handler_unittest.cc

Components: -Internals>Printing
Status: Fixed (was: Started)
As mentioned in comment 7, the original reported bug is not fixable. The best we can do is make Print Preview's Save As PDF consistent with Save As. (ctrl + s)

For the file:///path/to/test.png scenario, https://upload.wikimedia.org/wikipedia/commons/d/d9/Test.png is another example that can be used on any platform non-mobile platforms to verify what r529532 actually fixed.
Labels: Merge-Request-64
I tested 65.0.3323.0 canary with the PNG file in comment 9 and it works as expected.
Project Member

Comment 11 by sheriffbot@chromium.org, Jan 17 2018

Labels: -Merge-Request-64 Hotlist-Merge-Review Merge-Review-64
This bug requires manual review: We are only 5 days from stable.
Please contact the milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Thanks thestig@ - can you please comment on why this is critical? We're only few days away from stable. Has this been well tested and what are the implications if we fix this in M65?
It's not a critical regression, but it would be annoying for affected users for the duration of the M64 release. 
how widespread is this issue? how many users does it impact?
You can look at the PrintPreview.UserAction UMA histogram for actual usage data. The most common action from Print Preview is to print to a printer. Saving to PDF is the second most common action, but still a fraction of actual printing.

The fix to merge is well contained and only affects the Save to PDF filename suggestion. There are no stability risks and the fix is backed up by unit tests.
Labels: -Merge-Review-64 Merge-Approved-64
Great thanks for confirming. Approving merge for M64. Branch:3282
Project Member

Comment 17 by bugdroid1@chromium.org, Jan 20 2018

Labels: -merge-approved-64 merge-merged-3282
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48940713d488759c503b76629b25fbedbda88aa7

commit 48940713d488759c503b76629b25fbedbda88aa7
Author: Lei Zhang <thestig@chromium.org>
Date: Sat Jan 20 05:45:38 2018

M64: Make PdfPrinterHandler more consistent with downloads.

Offer better suggestions for file:///path/to/foo.png, and for webpages
without titles.

This is a manual merge of the non-test portion of r529055 and r529532.

TBR=rbpotter@chromium.org
BUG= 800147 

Change-Id: I031eff53a60c6ac6f2fe8b4ad725c6e90e7ae969
Reviewed-on: https://chromium-review.googlesource.com/877621
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/branch-heads/3282@{#559}
Cr-Branched-From: 5fdc0fab22ce7efd32532ee989b223fa12f8171e-refs/heads/master@{#520840}
[modify] https://crrev.com/48940713d488759c503b76629b25fbedbda88aa7/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
[modify] https://crrev.com/48940713d488759c503b76629b25fbedbda88aa7/chrome/browser/ui/webui/print_preview/pdf_printer_handler.h

Verified the fix on Mac 10.12.6, Win-10 and Ubuntu 14.04 using Chrome Beta version #64.0.3282.113 as per the comment# 16
Attaching screen shot for reference.
Observed that "saving a file as pdf doesn't contain original file extension" i.e., iphone.jpeg got saved as iphone.pdf when clicked on save as PDF from print window
Hence, the fix is working as expected.
Adding the verified labels.

Thanks...!!

800147.png
233 KB View Download
Cc: viswatej...@techmahindra.com sc00335...@techmahindra.com
Labels: TE-Verified-M64 TE-Verified-64.0.3282.113

Sign in to add a comment