Skip to content

When using renderPage for the watermark, links/hyperlinks do not work. #108

@rishav1710

Description

@rishav1710

When I pass my custom renderPage to the viewer, all my links are rendered as span tags, whereas if I don't use renderPage, all my links are rendered as anchor tags.

CASE -> CUSTOM RENDER PAGE

const renderPage: RenderPage = (enterFullScreenProps: RenderPageProps) => (
  <>
    {enterFullScreenProps.canvasLayer.children}
    {enterFullScreenProps.annotationLayer.children}
    {(props.contentFor === 'ENTERPRISE' || props.contentFor === 'SKILLS') &&
      props.watermarkDetailsData.watermarkType === 'TEXT_WATERMARK' && (
        <div>
        // my watermark code
      )}
    {enterFullScreenProps.textLayer.children}
  </>
);

 <Viewer
 //other props
 renderPage={renderPage}
 />
Image

CASE -> WITHOUT CUSTOM RENDER PAGE

 <Viewer
 //other props
 />
Image

In the official documentation for adding a watermark, the sample PDF provided also contains links that are not clickable. Refer here: https://react-pdf-viewer.dev/examples/add-a-watermark/

Is there any way to enable both the links and the watermark together?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions