I have tried to implement some functions to parse and
merge xfdf annotations to pdf. So far I could add most
of the annotations correctly but INK. 

INK node in xfdf:
<ink flags="print" page="0" subject="Pencil"
rect="121.893143,233.396851,555.599731,512.024353"
creationdate="D:20061024154708-04'00'"
name="K658gYBccP5ydJHzMNkdEB" color="#FF0000"
date="D:20061026092143-04'00'" title="xingying">
  <inklist>
   
<gesture>122.893295,480.805847;123.581375,482.182007;124.269455,482.870117;124.957535,484.934326;127.709839,486.998596;128.397919,487.686646;129.085999,489.062805;130.462158,490.438965;131.838303,491.815125;134.590622,495.943604;140.095245,499.383972;148.352173,503.512451;161.425659,507.64093;176.563385,509.01709;195.141495,510.39325;204.086502,510.39325;223.352692,507.64093;242.618881,502.136292;259.132751,494.567444;272.894287,487.686646;282.527405,480.805847;285.967773,473.92511;287.343933,465.668152;287.343933,456.035095;287.343933,445.713928;284.591614,436.080811;283.215454,425.071533;281.151245,413.374207;282.527405,403.74115;288.032043,395.484192;301.793579,388.603394;319.683594,383.786865;343.078247,383.098816;369.91333,383.098816;399.500671,385.851135;425.647644,389.291504;435.968811,391.355713;449.730347,396.172302;453.170776,400.30072;453.170776,403.05304;449.042297,404.429199;440.785339,405.805359;429.776123,403.74115;413.262207,396.860352;395.372192,388.603394;
380.234497,378.282227;372.665649,366.5849;369.22522,358.328003;370.601379,350.759094;380.234497,341.814087;395.372192,334.245239;415.326477,330.11676;435.968811,328.740601;458.675415,328.052551;482.758118,328.052551;506.840881,331.49292;526.795105,336.309509;541.244751,343.190247;546.74939,348.006836;552.942078,358.328003;553.630127,367.27301;550.877869,378.282227;547.437439,384.474976;542.620911,387.227234;535.740112,387.227234;527.483215,383.786865;515.785889,373.465698;502.024292,358.328003;486.886597,339.061768;471.060791,315.667114;457.299255,290.896301;442.849609,269.565918;429.088013,253.740112;413.950317,243.418945;397.436462,237.226242;378.858337,235.162003;357.527893,239.978561;342.390198,246.859344;327.940552,253.740112;321.059753,257.868591;306.610107,266.813599;288.720093,276.446716;274.958557,283.327454;266.01355,287.455933;263.94928,290.896301;263.94928,293.648621</gesture>
  </inklist>
  <popup flags="print,nozoom,norotate" page="0"
rect="612.000000,155.941406,792.000000,275.941406"
open="no"/>
</ink>

Java code to add annotation:

I tried 2 ways to create the ink annotation:
1. 
PdfAnnotation annotation =
PdfAnnotation.createInk(writer, rectangle, strContent,
inkList);
(where inkList is a double float array)
annotation.setPopup(inkPopup);

2.              
// create an annotation object with the given writer,
in the size of rectangle
PdfAnnotation annotation = new PdfAnnotation(writer,
this.rectangle);
annotation.put(PdfName.SUBTYPE, PDFName.INK);
annotation.setPage(page_number);
annotation.put(PdfName.CONTENTS, new
PdfString(strContent, PdfObject.TEXT_UNICODE));
annotation.setPopup(popup_annotation);
annotation.put(PdfName.INKLIST, new
PdfString(strInkList.trim(), PdfObject.TEXT_UNICODE));
addInkList(annotation);

Does anybody have any idea? I export the comment of
the output pdf to a xfdf file, openned the xdfd in
text editor. The result generated using the first
method (outofbox itext) show each pair of gesters as
<inklist>
  <gesture>319.2356,336.1223</gesture>
  <gesture>322.2356,345.7223</gesture>
  ...
</inklist>

and the result from the second method does not show
the gesture info at all.





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to