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
Uh oh!
There was an error while loading. Please reload this page.
-
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
DocumentonLoadSuccesscallback - this returns thePDFDocumentProxyobject, which I believe should be equal toPDFViewerApplication.pdfDocumentif 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
annotationStoragein this callback is always empty. However, if I load pages individually and get their annotations (or use theonGetAnnotationsSuccesscallback), 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
annotationStorageand use its helper methods.Beta Was this translation helpful? Give feedback.
All reactions