You would add variables in the interface, and there would be a secure sandbox in the client where you can call the API of your headless CMS, and with an sdk you could create PDF programmatically assigning the respective variables with values from your headless CMS API response. Then a button to print them. This keeps everything fully private in the browser while automating the process.
Would that work? For reference, what would you expect to pay for this if you wanted to go this route?