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.fdfMerge(fdfDoc);
pdfDoc.flattenAnnotations(false);
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 {
closeDocument(pdfDoc);
}
}
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);
this.annotation.setEndStyle("OpenArrow");
};
The arrow annotation just extends the Line Annotations in all other points.