Skip to content

Add ability to disable annotations (including bboxes in canvas) #963

@yuliya-ivaniukovich

Description

@yuliya-ivaniukovich

Before you start - checklist

  • I understand that React-PDF does not aim to be a fully-fledged PDF viewer and is only a tool to make one
  • I have checked if this feature request is not already reported

Description

At the moment it seems there is no way to pass ANNOTATION_MODE.DISABLED into render page canvas context:

annotationMode: renderForms ? ANNOTATION_MODE.ENABLE_FORMS : ANNOTATION_MODE.ENABLE,

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 rendering

Alternatives

Alternatively we can introduce a new property. That could be some specific like disableAnnotations or more generic like renderContext 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions