Polyline Vertices Specification

dant <[email protected]>
Newsgroups gmane.comp.java.lib.itext.general
Message-ID <[email protected]>
Please forgive my obtuseness, but I’m trying to create a PdfAnnotation
consisting of, for a simple example, an X pattern which I assume would be a
SUBTYPE of POLYLINE (one or more discontiguous line segments?). If so then I
think I’m providing the vertices incorrectly.If I specify vertices like
this:
*put(PdfName.SUBTYPE, PdfName.POLYGON);
float[] coords = { 100f, 100f, 200f, 200f, 100f, 200f, 200f, 100f };
put(PdfName.VERTICES, new PdfArray(coords));*
The following is generated:
*2 0 obj
&lt;&lt;/C[1 1
0]/Type/Annot/Contents(contents)/Title(title)/Subtype/Polygon/Rect[99 99 201
201]/Vertices[100 100 200 200 100 200 200 100]&gt;&gt;*
and I get a yellow hourglass shape as expected, annotation title/contents
are loaded correctly, and the annotation appears in the Acrobat Comments
List.
But if I change POLYGON to POLYLINE (hoping to get an X instead of an
hourglass), the (almost) identical PDF code is generated (Polyline replaces
Polygon):
*2 0 obj
&lt;&lt;/C[1 1
0]/Type/Annot/Contents(contents)/Title(title)/Subtype/Polyline/Rect[99 99
201 201]/Vertices[100 100 200 200 100 200 200 100]&gt;&gt;*
but a question mark appears instead of any line segments and no annotation
appears in the Comments List.
I’ve tried variations such as trying to create a PdfArray of PdfArrays,
placing all x-coords first, then all y-coords, etc. I have itext-pdfa-5.3.4
jars loaded.
Thanks very much…
- Dan



--
View this message in context: http://itext-general.2136553.n4.nabble.com/Polyline-Vertices-Specification-tp4660262.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/

_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.