-
Before you start - checklist
DescriptionI've tried the recipe for highlighting text here. It works fairly well, but it does not work with multiple lines. Lets say I know the bounds of a rectangle on a specified page (or I know multiple bounds), ie
Is there a way to highlight by these bounds instead of matching text? Steps to reproducen/a Expected behaviorn/a Actual behaviorn/a Additional informationThis isnt a bug, just a question Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
You can use https://codesandbox.io/s/react-pdf-watermark-5wylx?file=/src/index.jsx |
Beta Was this translation helpful? Give feedback.
-
@wojtekmaj thanks so much! i'll try it out |
Beta Was this translation helpful? Give feedback.
-
@wojtekmaj Thank you for the example. Is there a way to trigger re-rendering, for example when the bounds have changed? |
Beta Was this translation helpful? Give feedback.
You can use
canvasRef
prop to draw whatever you want on a given canvas. Here's an example with watermark added dynamically, but should be able to figure out how to draw anything else.https://codesandbox.io/s/react-pdf-watermark-5wylx?file=/src/index.jsx