Pdf with imported arc annotation xfdf does not render correctly

Product: WebViewer

Product Version: 10.10.1

Please give a brief summary of your issue: pdf with imported arc annotation xfdf does not render correctly

Please describe your issue and provide steps to reproduce it:

I used latest webViewer demo sample from

  1. download WebViewer.zip and extract to webViewer folder
  2. go to webViever\samples\viewing\viewing\viewing.js
  3. change it as follows:
const WebViewerConstructor = isWebComponent() ? WebViewer.WebComponent : WebViewer;

WebViewerConstructor(
  {
    path: '../../../lib',
    initialDoc: '',
	licenseKey: 'xxx',
  },
  document.getElementById('viewer')
).then(instance => {
  samplesSetup(instance);

  document.getElementById('select').onchange = e => {
    instance.UI.loadDocument(e.target.value);
  };

  document.getElementById('file-picker').onchange = e => {
    const file = e.target.files[0];
    if (file) {
      instance.UI.loadDocument(file);
    }
  };

  document.getElementById('url-form').onsubmit = e => {
    e.preventDefault();
    instance.UI.loadDocument(document.getElementById('url').value);
  };
  
    const {documentViewer} = instance.Core;

  documentViewer.addEventListener('documentLoaded', () => {
    registerAnnotationListeners(instance);
  });
  
});

function registerAnnotationListeners(instance) {
  const {annotationManager} = instance.Core;
  annotationManager.addEventListener("annotationChanged", (annotations, action, { imported }) => {
    if (annotations[0] instanceof instance.Core.Annotations.ArcAnnotation) {
        setTimeout(() => {
          exportAnn(annotationManager, annotations);
        }, 1000);
    }
  });

}

function exportAnn(annotationManager, annotations) {
  annotationManager.exportAnnotations({
	annotList: annotations,
	widgets: true,
	fields: true,
	links: true,
	useDisplayAuthor: true,
	generateInlineAppearances: true
  }).then( txt => console.log(txt));
}

  1. run ‘npm install’

  2. run ‘npm start’

  3. in browser go to http://localhost:3000/samples/viewing/viewing/

  4. open test.pdf

  5. in webViewer drop-down select Measure

  6. select arcAnnotation

  7. add annotation

  8. go to JS console

  9. copy paste xfdf output into text.xfdf file

  10. open test.pdf in adobe reader

  11. drag and drop test.xfdf into adobe reader window

  12. specify test.pdf as source pdf file

  13. observe opened xfdf - arc annotation is ok

  14. go to menu → save as → test-xfdf-merged.pdf

  15. open test-xfdf-merged.pdf in adobe to make sure that arc annotation is present

  16. go to https://showcase.apryse.com/

  17. open test-xfdf-merged.pdf

  18. no annotation is visible

  19. I’ve attached also test2-merged-using-java-api.pdf It’s same file but merged with same xfdf programmatically, using pdfTron java lib. It also rendered incorrectly but in a different way

1 Like

The issue is related to

1 Like

Test.pdf (11.0 KB)
test-xfdf.xfdf (34.6 KB)

1 Like

Test-xfdf-merged.pdf (27.3 KB)
test2-merged-using-java-api.pdf (35.4 KB)

1 Like

Hello @overbitskyi ,

Thank you for bringing this to our attention.

It appears you raised a similar issue here: Xfdf export of ArcMesaurement annotation works incorrectly

We will take a look at both issues together. This is raised to our Defect Backlog for our Product team to review.

We will be sure to reach out if the issue has been fixed with an experimental build to try.

Best Regards,
Jacob Romano Carlsen
Web Development Support Engineer
Apryse Software Inc.

1 Like