wojtekmaj/react-pdf ? reverse-engineered prompt
Reverse engineered prompt
Build me a small React library that lets people display existing PDF files in a web app as easily as dropping in an image. I want a simple viewer with a Document component and Page components, so a developer can pass in a file from a URL, base64 string, or raw binary data and render one or more pages. Include a basic demo page that shows a PDF, tracks how many pages it has, and lets you move between pages.
Please make sure the PDF worker is configured correctly in the same file where the viewer is used, since that tends to break otherwise. It should work in modern browsers, and if there are any special notes for Next.js or older browser support, handle them or document them clearly. Also include support for annotation links and selectable text layers with the needed styles.
Keep it clean, reusable, and easy to install and use. You can look up current docs online if you need to.
Are you gonna build this?
make sure you review the code using coderabbit