[poppler] FreeText font/border color in DA - ISO32k vs Adobe Reader vs poppler

Leonard Rosenthol lrosenth at adobe.com
Fri Aug 24 14:45:46 UTC 2018


I am usually reading...happy to help!

So, you should know that 32000-2 now mandates an appearance (/AP) so it may be time to consider adding that to Poppler (or at least putting it in the plans sooner rather than later)

Is there a sample PDF that demonstrates the difference?  I didn't see it in that long thread.

I did check our code, and we do fully support g/G, rg/RG, and k/K for setting the colors for both text and vectors via the /DA entry.   sc/SC won't work because they require a resources dictionary which you don't have in this context, so we don't check for that.  I also checked and we handle a number of the text operators as well, including Tr (though for value of 0, that's not necessary as it's the default GState).

Leonard

-----Original Message-----
From: poppler <poppler-bounces at lists.freedesktop.org> On Behalf Of Tobias Deiminger
Sent: Thursday, August 23, 2018 2:53 PM
To: poppler at lists.freedesktop.org
Subject: [poppler] FreeText font/border color in DA - ISO32k vs Adobe Reader vs poppler

I'm posting here, esp. in the hope Leonard Rosenthol is reading. Adobe Reader behaves differently than I had expected. Want to figure out what's going on, because of https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fpoppler%2Fpoppler%2Fissues%2F50&data=02%7C01%7Clrosenth%40adobe.com%7C345a06226a4949a7ad9508d60929ba06%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636706472167525632&sdata=y7VLnRCm2uifmZ%2FUQYssmAmH3ywERAXThK34fGLV1sU%3D&reserved=0.

Questions is, how shall one adjust font color and border color of FreeText annotations by means of /DA? I'm asking explicitely about situations where there's no /AP, because poppler can't write /AP atm.

ISO 32k tells us that /DA establishes graphics state in case there's no /AP. We can use text operators
- g/rg/k/sc, set color for nonstroking operations
- G/RG/K/SC, set color for stroking operations
- Tr, set text rendering mode, where 0 = "fill"

Drawing border is most likely a stroking operation, while drawing text glyphs in fill mode is a nonstroking operation. So I had expected Adobe Reader to take font color from g/rg/k/sc, and to take border color from G/RG/K/SC. In fact, Adobe Reader does so in the /AP entry. But it doesn't interpret /DA like this.

By trial I found Adobe Reader uses rg from /DA as border color, and doesn't take font color from /DA at all (text is always black). That confuses me quite a bit.
Is this really the Adobe interpretation of the standard?

If yes, and we follow the "do it like Adobe" guideline, this gets us into trouble. We can't simply use DA to set both font and border color, but have to embed AP, which means much more work left for #50.
_______________________________________________
poppler mailing list
poppler at lists.freedesktop.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fpoppler&data=02%7C01%7Clrosenth%40adobe.com%7C345a06226a4949a7ad9508d60929ba06%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636706472167525632&sdata=%2B%2BQo79emIzxpzB2J2LPcNpzfgkBi7eCVNX9Lm3w1DjI%3D&reserved=0


More information about the poppler mailing list