Replies: 1 comment
-
Do you know how to access modify and render annotations in reacts |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been using react-pdf for a bit and at this point I need to interact with the underlying PDF annotations (to do things like adjust background colors, write values, etc.). As far as I can tell, the intended hook into the pdf.js library is via the
Document
onLoadSuccess
callback - this returns thePDFDocumentProxy
object, which I believe should be equal toPDFViewerApplication.pdfDocument
if using pdf.js directly.Is this accurate? Or are there other ways to access the underlying library functionalities?
Secondly, the immediate issue that I'm running into is that
annotationStorage
in this callback is always empty. However, if I load pages individually and get their annotations (or use theonGetAnnotationsSuccess
callback), I'm presented with the annotation data properties correctly. It's unclear to me if I'm doing something incorrectly (do I need to refresh the annotation storage somehow?), or if this is the intended functionality.While I can mutate the annotation data directly, it seems cleaner if I could access it through
annotationStorage
and use its helper methods.Beta Was this translation helpful? Give feedback.
All reactions