-
-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to disable annotations (including bboxes in canvas) #963
Comments
Hey @yuliya-ivaniukovich, I totally hear you! Here's what I think: There are a number of components depending on We will need to do a better job at documenting things than Mozilla -
react-pdf/src/Page/PageCanvas.jsx Line 107 in d4ef2f5
Something like annotationMode:
annotationMode ?? (renderForms ? ANNOTATION_MODE.ENABLE_FORMS : ANNOTATION_MODE.ENABLE), should do the trick! Then, there's react-pdf/src/Page/AnnotationLayer.jsx Lines 103 to 116 in d4ef2f5
Sooo maybe: renderForms:
annotationMode !== null && annotationMode !== undefined
? annotationMode === ANNOTATION_MODE.ENABLE_FORMS
: renderForms, ? Then, in In What do you think? |
So, the idea is that passing |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days. |
This issue was closed because it has been stalled for 14 days with no activity. |
Before you start - checklist
Description
At the moment it seems there is no way to pass
ANNOTATION_MODE.DISABLED
into render page canvas context:react-pdf/src/Page/PageCanvas.jsx
Line 107 in d4ef2f5
We would like to have the ability to hide annotations at all, not only annotations layer.
Proposed solution
We can use existing
renderAnnotationLayer
prop to also hide annotations boxes during canvas renderingAlternatives
Alternatively we can introduce a new property. That could be some specific like
disableAnnotations
or more generic likerenderContext
which can have arbitrary props that override the defaults.Additional information
A bit later I'm going to propose a PR for this feature request, but would be great to discuss the preferable approach first
The text was updated successfully, but these errors were encountered: