Replies: 1 comment 4 replies
-
|
You can try to call the low-level API PDFViewerApplication.forceRendering();or PDFViewerApplication.pdfViewer.forceRendering() |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@stephanrauh Hi! This is related my previous message. Thanks for your response. I've been able to reach the underlying pdf.js via the global object PDFViewerApplication, and was able to start using the HighKite PDFAnnotate Library together with this viewer.
The issue is, when an annotation is added by using the annotationFactory provided by the PDFAnnotate library, the annotation is not immediately visible in the viewer. From the Console you can tell it's indeed added, but not visible in the viewer (see 1st snapshot attached). As a workaround, I now update the [src] of the viewer every time an annotation is added, forcing a reload. This will make the annotation just added show up. However apparently it may not be a good approach.
My question - I noticed that when using the ngx-extended-pdf-viewer native function NgxExtendedPdfViewerService.addEditorAnnotation(), the created annotation is immediately visible in the viewer without having to reload the source. How's that achieved? I'm hoping it's possible to replicate that and provide better viewing/annotating experience in my case.
On a sidenote, when [src] is updated, it seems that the onPDFLoaded() is called twice - see 2nd snapshot attached. On the 1st call, the pdfDocument is actually not ready. It's ready on the second call. Do you know why it happens twice?
Below is my code for reference:
html:
ts:
Beta Was this translation helpful? Give feedback.
All reactions