-webkit-background-clip not applied when printing to pdf
Reported by
a...@dytry.ch,
Sep 11
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 Example URL: https://codepen.io/anon/pen/zJWRge Steps to reproduce the problem: HTML: <style> #someText { font-size: 80px; font-weight: 700; background: linear-gradient(cyan, magenta); background-clip: text; -webkit-background-clip: text; color: transparent; } </style> <div id="someText">Some Text</div> Open the above HTML file (or the linked codepen) in Chrome and try to print. The preview renders correctly, but if you export to PDF, the text background isn't clipped. What is the expected behavior? The PDF appears similarly to the browser preview, with the background gradient clipped to the text What went wrong? The text background isn't clipped. Instead of writing, only a gradient rectangle is rendered. Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? No Firefox 62, Safari 11 Chrome version: 68.0.3440.106 Channel: stable OS Version: OS X 10.13.6 Flash Version:
,
Sep 12
One has to turn on "Background graphics" in Print Preview to see the text. It works here with the "Save as PDF" destination in Print Preview on Linux. (See attached PDF output) I'll try a Mac and see what happens there.
,
Sep 12
OK, so this gets interested. The attached SkPDF generated 883026.pdf displays correctly in Adobe Acrobat, Chrome, libpoppler-based PDF viewers, and PDF.js. It displays incorrectly in Mac Preview.app and MS Edge. Are some PDF viewers just buggy in this case? Dose the PDF contain something slightly ambiguous spec-wise?
,
Sep 12
The following revision refers to this bug: https://pdfium.googlesource.com/pdfium_tests/+/6cd71979b56e2bbf8bbc0521433e9d4b1b6908b1 commit 6cd71979b56e2bbf8bbc0521433e9d4b1b6908b1 Author: Lei Zhang <thestig@chromium.org> Date: Wed Sep 12 21:30:06 2018 Add more test PDFs to the corpus. The PDF author gave permission on one bug report, and the other is self-produced with Chromium. BUG= chromium:880920 ,chromium:883026 Change-Id: I1cafa9a777dedfcd8ba61a706d9bedd6a859bfdc Reviewed-on: https://pdfium-review.googlesource.com/42351 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> [add] https://crrev.com/6cd71979b56e2bbf8bbc0521433e9d4b1b6908b1/pdfium/bug_880920_expected.pdf.0.png [add] https://crrev.com/6cd71979b56e2bbf8bbc0521433e9d4b1b6908b1/pdfium/bug_883026.pdf [add] https://crrev.com/6cd71979b56e2bbf8bbc0521433e9d4b1b6908b1/pdfium/bug_883026_expected.pdf.0.png [add] https://crrev.com/6cd71979b56e2bbf8bbc0521433e9d4b1b6908b1/pdfium/bug_880920.pdf
,
Sep 12
The following revision refers to this bug: https://pdfium.googlesource.com/pdfium/+/01c91e48b2838957adaf675bdde20d860217c7ff commit 01c91e48b2838957adaf675bdde20d860217c7ff Author: Lei Zhang <thestig@chromium.org> Date: Wed Sep 12 21:44:12 2018 Roll testing/corpus/ e1005e0e7..6cd71979b (1 commit) https://pdfium.googlesource.com/pdfium_tests/+log/e1005e0e7857..6cd71979b56e $ git log e1005e0e7..6cd71979b --date=short --no-merges --format='%ad %ae %s' 2018-09-12 thestig Add more test PDFs to the corpus. Created with: roll-dep testing/corpus TBR=hnakashima@chromium.org BUG= chromium:880920 ,chromium:883026 Change-Id: I9298f3da42b6682c1aab7f0d43cc3a1e2d935573 Reviewed-on: https://pdfium-review.googlesource.com/42354 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org> [modify] https://crrev.com/01c91e48b2838957adaf675bdde20d860217c7ff/DEPS
,
Sep 12
The PDF is interesting enough that I added it to the PDFium test corpus. halcanary: I looked at the PDF and it seems well-formed. So I don't think we should do anything on our side. Instead, the bug reporter should file a bug with Preview.app. WDYT?
,
Sep 12
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cae0209f6aa85d1f229f47bec639d388639ae7b0 commit cae0209f6aa85d1f229f47bec639d388639ae7b0 Author: pdfium-chromium-autoroll <pdfium-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> Date: Wed Sep 12 23:22:44 2018 Roll src/third_party/pdfium 987416db2271..01c91e48b283 (2 commits) https://pdfium.googlesource.com/pdfium.git/+log/987416db2271..01c91e48b283 git log 987416db2271..01c91e48b283 --date=short --no-merges --format='%ad %ae %s' 2018-09-12 thestig@chromium.org Roll testing/corpus/ e1005e0e7..6cd71979b (1 commit) 2018-09-12 rharrison@chromium.org Optimize CPDF_CMapParser Created with: gclient setdep -r src/third_party/pdfium@01c91e48b283 The AutoRoll server is located here: https://autoroll.skia.org/r/pdfium-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary. BUG= chromium:880920 ,chromium:883026, chromium:881678 TBR=dsinclair@chromium.org Change-Id: I568df1014f4041ca53ea2aa93ef6837afd0b5329 Reviewed-on: https://chromium-review.googlesource.com/1222707 Reviewed-by: pdfium-chromium-autoroll <pdfium-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> Commit-Queue: pdfium-chromium-autoroll <pdfium-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com> Cr-Commit-Position: refs/heads/master@{#590855} [modify] https://crrev.com/cae0209f6aa85d1f229f47bec639d388639ae7b0/DEPS
,
Oct 10
halcanary: Per comment 3, can you decide whether we should do anything here, or mark this WontFix?
,
Oct 24
Here's what you are doing:
sk_sp<SkShader> shader() {
SkPoint points[2] = {{0, 0}, {0, 128}};
SkColor colors[2] = {SK_ColorBLUE, SK_ColorGREEN};
return SkGradientShader::MakeLinear(
points, colors, nullptr, 2,
SkShader::kClamp_TileMode, 0, nullptr);
}
void draw(SkCanvas* canvas) {
canvas->saveLayer(nullptr, nullptr);
SkPaint shaderPaint;
shaderPaint.setShader(shader());
canvas->drawRect({0, 0, 256, 128}, shaderPaint);
SkPaint layerPaint;
layerPaint.setBlendMode(SkBlendMode::kDstIn);
canvas->saveLayer(nullptr, &layerPaint);
p.setAntiAlias(true);
p.setTextSize(80);
canvas->drawString("TEST", 20, 90, p);
canvas->restore();
}
Maybe you could try this:
void draw(SkCanvas* canvas) {
SkPaint p;
p.setAntiAlias(true);
p.setTextSize(80);
p.setShader(shader());
canvas->drawString("TEST", 20, 90, p);
}
,
Oct 24
Attached simpler test PDFs.
,
Jan 11
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.
,
Yesterday
(36 hours ago)
Attaching test case.
,
Yesterday
(35 hours ago)
Attaching PDf from chrome-head-on-linux.
,
Today
(19 hours ago)
,
Today
(19 hours ago)
Attaching Adobe Reader screenshot
,
Today
(14 hours ago)
I asked around about this error:
https://groups.google.com/forum/#!topic/pdf-dev/QRc73S8G0sE
,
Today
(14 hours ago)
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by rtoy@chromium.org
, Sep 12Components: -Blink UI>Browser>PrintPreview
Labels: Needs-Feedback