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

Issue 732380 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

PDF's printing blank pages when job sent to printer

Reported by andy.h...@propertysoftwaregroup.com, Jun 12 2017

Issue description

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

Steps to reproduce the problem:
1. Produce a PDF which contains more than 1 document 
2. Click on the print icon in the browser to bring up the print dialog options down the left hand side of the screen
3. The 1st page (or document) is visible but subsequent pages are blank on screen. Also blank when the document is printed

What is the expected behavior?
All pages should be visible and should print correctly

What went wrong?
This used to work fine on v58. Open the attached document in Chrome and follow the steps in the "Steps to reproduce" window. The document should display and print fine.

Did this work before? Yes V58

Chrome version: 59.0.3071.86  Channel: stable
OS Version: 10.0
Flash Version:
 
Letter_7_Brochure.pdf
1.2 MB Download
Cc: thestig@chromium.org
Components: Internals>Printing UI>Browser>PrintPreview
Labels: ReleaseBlock-Stable pre-stable-59.0.3071.86 M-59 OS-Linux OS-Mac
Status: Available (was: Unconfirmed)
Able to reproduce the issue with latest Chrome stable i.e., 59.0.3071.86 on Windows 7,10, Mac and Linux. 

I see similar behavior on latest Chrome Beta, Dev and Canary, Working on bisect will update the result soon.
Cc: dsinclair@chromium.org abdulsyed@chromium.org tsepez@chromium.org
Components: Internals>Skia>PDF
Please find the bisect range : 

You are probably looking for a change made after 461950 (known good), but no lat
er than 461951 (first known bad).
CHANGELOG URL:
  https://chromium.googlesource.com/chromium/src/+log/bac4a9787174ce5e4bb7c4dded78f60550d667ba..06596a6f56b2b5ce13859d05f5b2a9434ee55a64

Cc: rbpotter@chromium.org
cc'ing  rbpotter@ since I see Lei is OOO today.
 andy.hair@ just curious to know is this only pdf where you are seeing the issue, Since when I tried other PDF's I wasn't able to reproduce the issue. Please let us know.
Cc: candr...@chromium.org amineer@chromium.org
Labels: OS-Android
cc'ing Alex and Christine to reproduce the issue on Mobile side as well.

Please remove the Android label if this isn't applicable.
Cc: gkihumba@chromium.org
Labels: OS-Chrome
+gkihumba@ - for ChromeOS
@pbomm... Our software produces a few documents like the attached where they will have a property brochure along with a covering letter. They are essentially 2 documents which are joined into 1 PDF when the final document generation takes place. The issue seems as though only the 1st part of the document is recognised. Our software also produces singular documents eg letters or single brochures and they print fine
Labels: -OS-Android
There's no Chrome PDF Viewer on Android.
@candr.. On Android I guess you would download it. I know in Windows if the PDF is downloaded and printed from Adobe then the job prints as expected. 
The issue is this CL:
https://pdfium.googlesource.com/pdfium.git/+/abf16c0682a545db4e9bae5510dd398a6ae634a3

Specifically the problem seems to be the change to check len <= 0 vs len < 0 here: https://cs.chromium.org/chromium/src/third_party/pdfium/core/fpdfapi/parser/cpdf_syntax_parser.cpp?l=730

This can't be reversed easily at tip of tree or anywhere after the following commit: https://pdfium.googlesource.com/pdfium.git/+/5b590337e0778b49dd7092af4a283ed0f9c5a2e9 as this commit adds an assert that fails if you allow length = 0 through.
Labels: -Pri-2 Pri-1
Owner: dsinclair@chromium.org
Status: Assigned (was: Available)
@dsinclair if its any use we could have a skype chat and I can screen share and show you the issue in more detail
What does bringing up print preview do differently vs displaying the PDF? The PDF renderers correctly in the chrome viewer, it's just on print preview that things go weird?
Status: Started (was: Assigned)
The problem is that the document contains zero length streams. So, when the CPDF_Creator code is running to generate the print PDF the stream decode will exit early and the creator code will exit and not generate the page.

25 0 obj
<<
/Filter /FlateDecode
/Length 0                                                                                                                        
>>
stream
endstream
endobj

I don't think this needs to block M59, I can merge the fix into Beta once it's baked for a few days if desired, but this seems like a bit of an edge case.

andy.hair@ is there a reason why your software is generating streams with length of 0? (I can see a bunch of them in the document you provided, objects 25, 26, 29, 30, 34, 35, 38, and 39.)
As an update, it isn't the save code that doesn't like zero length streams, it's the FPDF_ImportPages code which is early exiting. This is what chrome uses when it's generating the print preview PDF.
@dsinclair the tool we use to create them is http://www.evopdf.com/. It did work fine on the previous build of Chrome not sure why streams are being generated with 0 length though
Cc: -amineer@chromium.org
Components: -Internals>Skia>PDF
Project Member

Comment 20 by bugdroid1@chromium.org, Jun 13 2017

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

commit 957480c17682008ae2a14723868fcdcab89b6577
Author: Dan Sinclair <dsinclair@chromium.org>
Date: Tue Jun 13 19:33:05 2017

Allow zero length streams when parsing.

It's possible to create a stream of length 0 in a PDF document.
Currently the code will early exit and return a nullptr. This causes
issues when you want to print the given PDF as the FPDF_ImportPages code
ends up only generating up to the zero length object.

This CL allows creating streams with length 0 and updates the PDF saving
code to output a blank stream.

Bug:  chromium:732380 
Change-Id: I44182ba4aaac7c51284b002ba01bbc34b6bcf9e0
Reviewed-on: https://pdfium-review.googlesource.com/6490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>

[add] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/testing/resources/zero_length_stream.pdf
[modify] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/testing/embedder_test.h
[modify] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/core/fpdfapi/parser/cpdf_syntax_parser.cpp
[modify] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/testing/embedder_test.cpp
[modify] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/fpdfsdk/fpdfppo_embeddertest.cpp
[modify] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/core/fpdfapi/edit/cpdf_creator.cpp
[add] https://crrev.com/957480c17682008ae2a14723868fcdcab89b6577/testing/resources/zero_length_stream.in

Status: Fixed (was: Started)
This is fixed in PDFium and should roll into Chrome in the next few hours. Once it's been verified on Canary we can look to roll into M59 and M60 branches.
Labels: Merge-TBD
[Auto-generated comment by a script] We noticed that this issue is targeted for M-59; it appears the fix may have landed after branch point, meaning a merge might be required. Please confirm if a merge is required here - if so add Merge-Request-59 label, otherwise remove Merge-TBD label. Thanks.
Labels: -Merge-TBD Merge-Request-60 Merge-Request-59
Project Member

Comment 24 by sheriffbot@chromium.org, Jun 13 2017

Labels: -Merge-Request-60 Hotlist-Merge-Review Merge-Review-60
This bug requires manual review: M60 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
 Issue 730092  has been merged into this issue.
Cc: -abdulsyed@chromium.org pbomm...@chromium.org
Labels: -Merge-Request-59 -Merge-Review-60 Merge-Approved-59 Merge-Approved-60
fix looks good in canary. As confirmed, fix is also safe and well tested. Approving merge for M59 and M60. 
Project Member

Comment 27 by bugdroid1@chromium.org, Jun 14 2017

Labels: -merge-approved-59 merge-merged-3071
The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/0c17bdac6ce07754402385720d3a0e70ce179949

commit 0c17bdac6ce07754402385720d3a0e70ce179949
Author: Dan Sinclair <dsinclair@chromium.org>
Date: Wed Jun 14 19:27:06 2017

[Merge M59] Allow zero length streams when parsing.

It's possible to create a stream of length 0 in a PDF document.
Currently the code will early exit and return a nullptr. This causes
issues when you want to print the given PDF as the FPDF_ImportPages code
ends up only generating up to the zero length object.

This CL allows creating streams with length 0 and updates the PDF saving
code to output a blank stream.

Bug:  chromium:732380 
Change-Id: I44182ba4aaac7c51284b002ba01bbc34b6bcf9e0
Reviewed-on: https://pdfium-review.googlesource.com/6490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
(cherry picked from commit 957480c17682008ae2a14723868fcdcab89b6577)
Reviewed-on: https://pdfium-review.googlesource.com/6556
Reviewed-by: Nicolás Peña <npm@chromium.org>

[add] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/testing/resources/zero_length_stream.pdf
[modify] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/testing/embedder_test.h
[modify] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/core/fpdfapi/parser/cpdf_syntax_parser.cpp
[modify] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/testing/embedder_test.cpp
[modify] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/fpdfsdk/fpdfppo_embeddertest.cpp
[modify] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/core/fpdfapi/edit/fpdf_edit_create.cpp
[add] https://crrev.com/0c17bdac6ce07754402385720d3a0e70ce179949/testing/resources/zero_length_stream.in

 Issue 733239  has been merged into this issue.
@dsinclair, what timeframe are we looking at for roll out to the main browser?
The change has been merged into both the stable and beta branches. So, whenever the next version of those is released the fix should be included.
This is already merged on to Stable (#27),approved for Beta also. So please merge to branch 3112 ASAP.
re: comment 29 - For Chrome 59, it's in 59.0.3071.103 and newer. I don't have an exact date for when the roll out will occur for any particular install.
Ping for #31, planning to have a Beta release early next week.
Labels: -Hotlist-Merge-Review
Labels: -Merge-Approved-60 merge-merged-3112
This was merged into branch 3112 last Wednesday (Jun 14th)[1]. I don't know why the bugdroid didn't update the bug.


1 - https://pdfium.googlesource.com/pdfium/+/chromium/3112

Sign in to add a comment