[ https://issues.apache.org/jira/browse/PDFBOX-4627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16904624#comment-16904624 ]
Tilman Hausherr edited comment on PDFBOX-4627 at 1/2/25 8:00 PM: ----------------------------------------------------------------- quick and dirty fix for processStreamOperators(), I may improve that a little bit: {code} boolean process = true; if (contentStream instanceof PDTilingPattern && ((PDTilingPattern) contentStream).getPaintType() == PDTilingPattern.PAINT_UNCOLORED) { String name = ((Operator) token).getName(); if ("cs".equalsIgnoreCase(name) || "g".equalsIgnoreCase(name) || "k".equalsIgnoreCase(name) || "rg".equalsIgnoreCase(name) || "sc".equalsIgnoreCase(name) || "scn".equalsIgnoreCase(name)) { process = false; } } if (process) { processOperator((Operator) token, arguments); } {code} Surprisingly, it's just your file that is affected. None of my 1000 test files shows a change. was (Author: tilman): quick and dirty fix for processStreamOperators(), I may improve that a little bit: {code} boolean process = true; if (contentStream instanceof PDTilingPattern && ((PDTilingPattern) contentStream).getPaintType() == PDTilingPattern.PAINT_UNCOLORED) { String name = ((Operator) token).getName(); if ("scn".equalsIgnoreCase(name) || "cs".equalsIgnoreCase(name) || "g".equalsIgnoreCase(name) || "k".equalsIgnoreCase(name) || "rg".equalsIgnoreCase(name) || "sc".equalsIgnoreCase(name) || "scn".equalsIgnoreCase(name)) { process = false; } } if (process) { processOperator((Operator) token, arguments); } {code} Surprisingly, it's just your file that is affected. None of my 1000 test files shows a change. > Wrong color of uncolored tiling pattern > --------------------------------------- > > Key: PDFBOX-4627 > URL: https://issues.apache.org/jira/browse/PDFBOX-4627 > Project: PDFBox > Issue Type: Bug > Components: Rendering > Affects Versions: 2.0.16 > Reporter: Jiri Kunhart > Priority: Major > Attachments: after_fix.png, before_fix.png, > uncolored_tiling_pattern.patch, uncolored_tiling_pattern.pdf > > > The attached pdf file with uncolored tiling pattern is rendered wrongly (see > "before_fix.png"). The problem is that pattern stream contains > /DevGrayCS cs > which overwrites PDPattern color space stored in > PDGraphicsState#nonStrokingColor. I did a small fix which ignores all > settings of color space inside of uncolored tiling pattern stream and the > result seems to be good (see "after_fix.png"). > Note: the pattern in the png file looks diferently than in the original pdf > file, but this should be handled probably in the other issue. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org