Define the requirements yourself
Someone reading a PDF in our React app might be using a public computer. One click on the viewer’s Download button could leave an unprotected copy in the Downloads folder for the next person to find. I still wanted readers to be able to take a copy with them. When they chose to download it, the app would ask them to create a password and give them a PDF that required that password to open.
My question to ChatGPT was shorter:
Can I show the pdf in react app without downloading?
ChatGPT suggested PDF.js and react-pdf. I followed up by asking what would happen if a reader right-clicked and chose Save As. That got me closer to the behavior I cared about. A custom viewer would let me hide the standard Download button and suppress the right-click menu. I could then give readers a download action of my own, with the password step built into it.
The public-PC scenario gave me a way to evaluate the answer. I could picture a reader opening the document, deciding they wanted a copy, and clicking Download. Walking through those actions showed me exactly where the application needed control. It also gave me a reason to keep exploring the two libraries ChatGPT had suggested.
Ask for the same feature two ways
I asked ChatGPT for a PDF.js React component. It showed me an example that loaded a document and rendered its pages. Then I asked:
What if with react-pdf?
That short follow-up worked because the comparison was already set up. I could look at two examples of the same feature and see what adopting each approach would mean for my application.
The react-pdf example made rendering pages feel familiar to a React developer. Once I could see how to get a page onto the screen, I wanted to know how much code I’d own after that. How would a reader search the document or jump to a bookmark? Which controls would I have to assemble and maintain? The discussion also introduced me to PDF.js’s viewer components, which would let me reuse its navigation. I had a specific requirement in mind that would help me decide how much of the viewer I wanted to build.
Bring a project requirement into the comparison
The app needed to display its own bookmark labels. Suppose a PDF calls a bookmark “Section 3,” while “Installation” would mean more to someone reading it in our app. Clicking “Installation” should take the reader to the same place as clicking “Section 3” in the original document.
Here’s how I put the question to ChatGPT:
Is it possible to provide bookmark aliases or descriptions in pdf.js without changing the pdf?
The phrase “without changing the pdf” did a lot of work. I had already decided that the custom label belonged to the application. What I needed to learn was whether the viewer gave me enough control to display that label and still use the bookmark’s original destination.
ChatGPT explained how the application could read the document’s outline and supply a label when displaying an entry. Looking at the examples side by side, I could see how narrow the customization was. I chose to reuse PDF.js’s navigation and put the labels in React. The project reached a working demonstration of bookmark aliases.
Decide what to hand back to ChatGPT
My early questions were broad because I was learning my way around unfamiliar technology. By the time I understood the options, I could describe a much smaller implementation task. Here’s how I’d phrase it today:
Add optional bookmark labels to the React viewer. Show the application’s label when one is supplied and the document’s title otherwise. When a reader clicks a bookmark, pass its original destination to the existing PDF.js navigation. Keep the source PDF unchanged.
That request gives me a straightforward review. I can take “Section 3,” give it the label “Installation,” and check where it leads. I can also explain why the change belongs in React and why the click should still go through PDF.js. Those decisions came from the research I did before asking for implementation.
What I’d reuse on another project is the sequence of questions. Start with the user’s situation. Follow up with the exact action that matters, like choosing Save As on a public PC. Ask to see the same feature implemented two ways. Then use one of your own requirements to decide which parts of the system you want to own.
That sequence brings together two ideas from my book "AI-Assisted Software Engineering: Mental Models for Building Software in the Age of Generative AI". Chapter 6 covers how I use AI to learn unfamiliar technology. Chapter 2 covers how I turn what I’ve learned into engineering decisions that guide the implementation.
The free sample includes the Introduction and the full Chapter 2, "Allocating Engineering Decisions": which engineering decisions you should never delegate to AI, which ones you can, and why large requests produce poor results.

