Skip to content

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

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

Open
rishav1710 opened this issue May 7, 2025 · 0 comments
Open

Comments

@rishav1710
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant