Possible Bug when rendering line annotations with head and tail?

I have a strange behavior as i use line annotations with head- and tailstyle.
When i merge a generated XFDF from the webviewer with the original PDF in PDFNet, the head and the tail of my line annotations seems to be swapped.

I have attached the original pdf file, the xdfd file generated by the viewer, a screenshot of the viewer and the pdf merged by pdfnet.

Can somebody please confirm the Bug? Either the Webviewer or PDFNet is doing it the wrong way.

My Java Code for PDFNet is

public InputStream merge(InputStream document, InputStream annotations) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        PDFDoc pdfDoc = null;
        try {
                FDFDoc fdfDoc = FDFDoc.createFromXFDF(IOUtils.toString(annotations, "UTF-8"));
                pdfDoc = openDocument(document);

                pdfDoc.save(baos, 0, null);
                return new ByteArrayInputStream(baos.toByteArray());
        } catch (PDFNetException | IOException e) {
                throw new RuntimeException("PDF-Document konnte nicht erstellt werden.", e);
        } finally {

My customized Code in the config-javascript for the webviewer is

ArrowCreateTool.prototype = new Tools.LineCreateTool();
ArrowCreateTool.prototype.mouseLeftDown = function(e) {
Tools.LineCreateTool.prototype.mouseLeftDown.call(this, e);


The arrow annotation just extends the Line Annotations in all other points.

2-viewer screenshot.PNG

2-xfdf-by-viewer.xfdf (988 Bytes)

3-pdfnet-merge-flatened.pdf (6.46 KB)

1-input.pdf (4.85 KB)

New finding:
There is no difference in tail=“OpenArrow” and head=“OpenArrow”. No matter which parameter you set in the XFDF, PDFNet always renders the OpenArrow at the start point of the line Annotation. This is definitely a bug.

The only ugly workaround i can think of is to parse the xml before calling FDFDoc.createFromXFDF and switch start and end of the line annotation.

Thank you for the report.

This is fixed, and will be available in our nightly builds.


Hi Ryan,
do you have an ETA for a new release in which this fix is included?
Thanks and kind regards

It is already available.


If you let me know exactly what you use (windows C#? linux 64bit and Java?) I can send the exact link you need.