We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Sample code to create PolylineAnnotation

Hi Aspose,


My code below to create PolylineAnnotation does not work in some PDF Viewer:

Point[] vertices = new Point[5];

… Some data for vertices

PolylineAnnotation polylineAnno = new PolylineAnnotation(firstPage, rect, vertices);
polylineAnno.setTitle(“Polyline title”);
polylineAnno.setContents("Annotation for text: " + textFragment.getText());
polylineAnno.setColor(Color.getYellow());

firstPage.getAnnotations().add(polylineAnno);

The resulting attached pdf file’s polyline annotation can be viewed in Adobe but not in other pdf viewers, can you please let me know what I’m missing here? Thank you.

Best Regards,
Tuyen

Hi Tuyen,


Thanks for contacting support.

I have tested the scenario and have managed to reproduce the issue that PDF file having polyline annotation can only be viewed in Adobe. For the sake of correction, I have logged a ticket PDFJAVA-36700 in our issue tracking system. We will further look into the details of this issue and will keep you updated on the status of its resolution within this forum thread. Please be patient and spare us little time.

We are sorry for this inconvenience.

Best Regards,

Hi Tuyen,


We have investigated it further and observed this is not a bug of Aspose.Pdf project, but a restriction of Chromium Engine that used by Chrome browser (please, see feature request for display more annotation types in Chrome https://bugs.chromium.org/p/chromium/issues/detail?id=702228. Note that this issue is not resolved yet).

If you need further assistance, please feel free to contact us.

Best Regards,