Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDF Spec vs Acrobat creation (QuadPoints)

I've created some annotations (Underline, Highlight, Strikeout, Squiggly) in Acrobat and am digging out the QuadPoints array to render with. The pdf spec PDF 32000-1:2008 says they are in counter clockwise order, and x1,y1 -> x2,y2 specifies the base of the quadrilateral.

This should look like: BottomLeft, BottomRight, TopRight, TopLeft

Unfortunately, Acrobat seems to create them in a different (and non compliant manner).

It appears as if the order is: TopLeft, TopRight, BottomLeft, BottomRight.

Anyone have insight into this phenomenon? Is it consistent? Am I missing something?

like image 221
tillerstarr Avatar asked Mar 24 '12 21:03

tillerstarr


Video Answer


1 Answers

I've written a PDF annotation lib for iOS and found the same against-the-spec Acrobat behavior.

As a bit of further info, the Text Markup annotation also contains an Rect entry as well as the QuadPoints entry. The Rect entry is per the spec, [llx, lly, urx, ury]. So in Acrobat generated Text Markup annotations, the Rect point (llx,lly) is approx the same as the QuadPoints point (x3, y3) when rotation=0. Go figure.

Interesting the amount of time that can be wasted when the primary company behind a spec writes software that doesn't follow that spec!

like image 150
dingo sky Avatar answered Oct 29 '22 02:10

dingo sky