Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Wrong placement with certain annotations on XOD documents with alternating page sizes #1087

Closed
Mallne opened this issue Jan 30, 2025 · 3 comments

Comments

@Mallne
Copy link

Mallne commented Jan 30, 2025

WebViewer version
11.2.0
The current behavior
Polyline and Circle Annotations move when the XOD Document is reopened
The expected behavior
The Annotations should stay at the created Position
Steps to reproduce
This may be a very specific usecase, but we have documents with alternating page sizes and orientations. Those get
delivered as a XOD document. The annotations get loaded and saved to a different service using
annotationManager.importAnnotations(...) and annotationManager.exportAnnotations(...). (The service does not alter
the data!)
After the document is reopened, the Circle and Polyline annotations are shifted to a different position. This happens
not on the first page and probably not on pages that are the same size as the first (mostly on rotated pages). If the document is a PDF, not a XOD,
this is fixed. The sizing box of the annotations remain in the correct position.
If the "moved" annotations get saved and the document gets merged with the annotations in the Backend using:

fdfDoc = FDFDoc.createFromXFDF(IOUtils.toString(annotations, StandardCharsets.UTF_8));
pdfDoc = this.openDocument(document);
pdfDoc.flattenAnnotations(false);
pdfDoc.fdfMerge(fdfDoc);

the before "moved" annotations are now in the correct place again.
We use the WebViewer together with Vite and Typescript to build a static site.

Example Before
Image

Example After
Image

@bollain
Copy link
Collaborator

bollain commented Jan 31, 2025

hey @Mallne,

Thanks for this report - to allow our support to look at this in more detail please submit this via our support portal:
https://apryse.com/form/request

This will ensure we get the right people on it as soon as possible. Please include steps to reproduce this and any documents where this happens.

@Mallne
Copy link
Author

Mallne commented Feb 11, 2025

In case anyone is stumbeling across this: The annotations got imported in the documentLoaded event. Switching to the annotationsLoaded event seems to be working.

@Mallne Mallne closed this as completed Feb 11, 2025
@bollain
Copy link
Collaborator

bollain commented Feb 11, 2025

Thanks for the follow up @Mallne!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants