You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 DocumentonLoadSuccess callback - this returns the PDFDocumentProxy object, which I believe should be equal to PDFViewerApplication.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 the onGetAnnotationsSuccess 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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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