pdf-association / pdf-issues

Industry-based resolutions for issues and errata reported against any PDF-related specification
https://pdf-issues.pdfa.org/
62 stars 2 forks source link

12.5.6.13 (Ink annotations): constraint inconsistency between Vertices and Path entries #444

Closed stechio closed 1 week ago

stechio commented 3 weeks ago

Polygon and polyline annotations (12.5.6.9) and ink annotations (12.5.6.13) feature a newer (PDF 2.0) optional Path entry alongside the older simple vertex array entry (respectively, Vertices and InkList). Despite this simmetry, the respective constraints oddly diverge:

PROPOSAL

I propose to harmonize the InkList entry (Table 185 — Additional entries specific to an ink annotation) to the corresponding Vertices entry (Table 181 — Additional entries specific to a polygon or polyline annotation), replacing its constraint ("(Required)") with the following:

(Required unless a Path key is present, in which case it shall be ignored)
petervwyatt commented 3 weeks ago

I agree this is odd. I imagine the reason for Ink annotations was that InkList was Required in PDF 1.x and for backward compatibility of PDF 2.0 files with PDF 1.x processors it needed to remain required so the Ink annot could still be processed by old SW. But I can't explain why Polygon/Polyline didn't have the same thinking...!

My feeling is that both InkList and Vertices entries should remain required (as per PDF 1.7) but "shall be ignored" whenever the newer PDF 2.0 Path entry is present - that both guarantees backward compatibility and makes them the same.

Does anyone else remember historic discussions?

stechio commented 3 weeks ago

@petervwyatt:

My feeling is that both InkList and Vertices entries should remain required (as per PDF 1.7) but "shall be ignored" whenever the newer PDF 2.0 Path entry is present - that both guarantees backward compatibility and makes them the same.

Your interpretation does make sense, actually — it's the "unless" conjunction ("Required unless a Path key is present [...]") which causes confusion, wrongly suggesting that the two entries may be mutually exclusive.

So, algorithmically, InkList and Vertices entries should always be defined, supplemented by Path entries in case the extra capabilities of the latter (in particular, curveto operations) are needed: in such case, InkList and Vertices entries will contain a flattened (ie, interpolated between its end points) rendition of the curved path defined in Path entries.

PS: Such connection between flat path (InkList entry) and full path (Path entry) makes even odder their functional gap (see #445).

petervwyatt commented 3 weeks ago

Proposed solution to change Table 181, Vertices and Table 185, InkList to both state:

"(Required) Shall be ignored if Path is present."

petervwyatt commented 1 week ago

PDF TWG agree