Bug 697532 - Text Transparency Knockout
Summary: Text Transparency Knockout
Status: CONFIRMED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Transparency (show other bugs)
Version: master
Hardware: All All
: P1 enhancement
Assignee: Robin Watts
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-01 08:33 UTC by Michael Vrhel
Modified: 2023-05-23 16:46 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
fts_21_2101_edit.pdf (8.85 MB, application/pdf)
2017-02-01 08:33 UTC, Michael Vrhel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vrhel 2017-02-01 08:33:47 UTC
Created attachment 13342 [details]
fts_21_2101_edit.pdf

The text knockout code needs additional work in that we really need to know if there are any non-normal blend modes or opacity values less than 1.0 within the BT/ET pair.  Right now, we don't push the group until we encounter such a condition in pdf_text_begin.   Any text that was drawn with full opacity and a normal blend prior to that will not be within the knockout group.   The alternative of always pushing the text even if we have an opacity of 1.0 and a normal blend mode is not really a good solution.   

An approach suggested by Ray is to have the pdf14 device accumulate the commands between the BT/ET pair.  This is likely the preferred approach as it would also be possible to get the bounding box prior to the group push.  Currently we push a group the same size as the parent.  

Currently I am avoiding problems with BT/ET mismatches/nesting etc through careful filtering in the pdf14 device and its interactions with the interpreter.  Chris had mentioned that there are files out there that have images and other disallowed content between a BT/ET pair.   We would have to consider how best to handle those cases if we were to create what amounts to a simple display list for the BT/ET pair in the pdf14 device.

Attaching a simple file which is derived from FTS_21_2101.pdf as an example problem.
Comment 1 Peter Cherepanov 2020-12-29 19:53:58 UTC
The problem is reproduced in the current master branch. Acrobat knocks out the blue text, but Ghostscript still blends blue and pink text.