Annotations are loaded but not visible after loading a document

108 views
Skip to first unread message

Renson Dimaculangan

unread,
Nov 16, 2017, 9:29:32 PM11/16/17
to PDFTron WebViewer
We're currently encountering issues on rendering the annotations. We would like to bypass the process of clicking the annotations before it reflects and have it loaded upon the rendering of the document. The annotations are loaded on the list but when the document is rendered, the annotations are not reflected. I tried hovering on the place of the annotation and it seems that the annotation is there but is not visible.

Hoping you can help us out on this issue. Thanks.

David Compton

unread,
Nov 17, 2017, 11:50:37 AM11/17/17
to PDFTron WebViewer
I've noticed this happen as well.  Sometimes it seems to be if you have two pages visible side by side, both with annotations, then the annotations only appear on one of the pages.  When you click/focus the other page then the annotations appear there as well.

On 17 November 2017 at 12:23, Renson Dimaculangan via PDFTron WebViewer <pdfnet-webviewer+APn2wQet6nAXWcq...@googlegroups.com> wrote:
We're currently encountering issues on rendering the annotations. We would like to bypass the process of clicking the annotations before it reflects and have it loaded upon the rendering of the document. The annotations are loaded on the list but when the document is rendered, the annotations are not reflected. I tried hovering on the place of the annotation and it seems that the annotation is there but is not visible.

Hoping you can help us out on this issue. Thanks.

--
You received this message because you are subscribed to the Google Groups "PDFTron WebViewer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfnet-webviewer+unsubscribe@googlegroups.com.
To post to this group, send email to pdfnet-webviewer@googlegroups.com.
Visit this group at https://groups.google.com/group/pdfnet-webviewer.
For more options, visit https://groups.google.com/d/optout.

Justin Jung

unread,
Nov 17, 2017, 3:27:32 PM11/17/17
to PDFTron WebViewer on behalf of David Compton
Would you be able to send us the document that you see this issue on? Does this issue occur in an uncustomized WebViewer?
If you are able to send us a short video of the issue, that would be helpful as well.

David, we are having trouble reproducing this issue. Do you have any more specific steps that would cause the issue to be more likely to occur?

Justin Jung
Software Developer
PDFTron Systems Inc.

Bernát Gyovai

unread,
Jul 10, 2018, 12:57:37 PM7/10/18
to PDFTron WebViewer
Hi, we're running into this issue as well. Please investigate. I'll be watching this thread to help.

We have a customized WebViewer, we didn't try with a virgin one.
At first this issue showed only with a subset of documents. Usually the larger ones. By now, annotations won't render on any document. Be it a one-pager or 100 pager.
We didn't touch the files you bundle WebViewer with, but we have a large config.js, and a controller instance which handles saving / loading annotations.

At the time that this seems to have switched to affect all documents we have done the following (but I'm unsure if this has anything to do with the issue):
We used WebViewer 3.1.0 and the issue is happening in readonly & normal modes.
Cache has always been emptied after each deploy.
- The server SDK (PDFNet) has been updated from 6.7.1 to 6.8.0
- The default zoom level has been changed to 100%
- The thumbnails panel has been hidden by default.
- Tools.TextAnnotationCreateTool.AUTO_SET_TEXT has been set to false.

We have since updated WebViewer to 3.2.1 and the issue persists.

This is hugely important to us.
Thank you in advance!

Matt Parizeau

unread,
Jul 10, 2018, 1:50:36 PM7/10/18
to PDFTron WebViewer
Hi Bernát,

Are there any errors in the developer console? Would you be able to send a link to your site or a sample project where we can reproduce this issue? Unfortunately it's difficult to tell what's going on since we can't reproduce the problem.

Thanks,

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Bernát Gyovai

unread,
Jul 11, 2018, 1:08:25 PM7/11/18
to PDFTron WebViewer
Hi,

We're currently thinking about how we could share a link as we work in a strict intranet. I'll be back in some time.

There are no errors nor warnings in the console. Everything seems completely normal. It's just the rendering on the actual document that seems to be "missing" until it is refreshed by clicking on annotations.
By the way we have some overhead in our WebViewer events. We call our services in them, could there be a problem if you guys' events get delayed by about a second (2 at most)? Could that cause an issue, like skipped rendering?

Matt Parizeau

unread,
Jul 11, 2018, 4:10:07 PM7/11/18
to PDFTron WebViewer
Overhead in WebViewer events shouldn't cause an issue with rendering. What code are you using to import annotations in the document? If you're calling importAnnotations or importAnnotationsAsync yourself then you'll need to call drawAnnotations or drawAnnotationsFromList to have them render immediately. For example:

annotManager.importAnnotationsAsync(xfdf, function(annotations) {
  annotManager
.drawAnnotationsFromList(annotations);
});

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Bernát Gyovai

unread,
Jul 12, 2018, 12:23:24 PM7/12/18
to PDFTron WebViewer
This fixed the issue. However I'm concerned by the fact that we never had to do this before. We didn't redraw the annotations, and everything seemed fine.
Is this a recent change? Should we worry about things like this that could creep up on our implementation with time?

Is this a quasi-bug that could still be fixed by you? Or is this the intended behavior? If you guys still want / need a link, we could provide one on monday. 

Justin Jung

unread,
Jul 12, 2018, 6:26:53 PM7/12/18
to PDFTron WebViewer
Hello Bernát,

Matt is currently on vacation so I'll try my best to answer your question.
I think that the issue has happened in the documents (especially larger ones) due to the pages being rendered before the annotations were imported from the server.
Perhaps the documents that had no issue were just lucky to fetch all annotations before page rendering began.
But we do want our customers to have control over when to draw the annotations, since canvas rendering is directly related to the performance.
I will double check with Matt just to make sure when he gets back :)

Matt Parizeau

unread,
Jul 17, 2018, 5:56:38 PM7/17/18
to PDFTron WebViewer
Hi Bernát,

What Justin said is correct, it's intended behavior that you should call drawAnnotations or drawAnnotationsFromList after adding your annotations so that you have control over when they render and this behavior hasn't changed. You might be lucky and the page rerenders for another reason (e.g. panel opens to change zoom level) so the annotations show up, but it isn't a good idea to rely on this.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Bernát Gyovai

unread,
Jul 18, 2018, 12:58:31 PM7/18/18
to PDFTron WebViewer
Ok. Thank you for your assistance.
Reply all
Reply to author
Forward
0 new messages