Ask HN: It seems to be impossible to find-replace text in a PDF at scale?
So far I have tried:
* pdftk via bash script
* qpdf via bash script
* PyPDF2
* pdf-lib via node
In all cases, it appears the PDF content is not in plain text, so the text replacement fails.
Often I'm getting:
> Unsupported contents type: <class 'PyPDF2.generic.TextStringObject'>
I'm surprised it's this hard to do a find-replace inside a PDF. Isn't there a Homebrew util for this?
GPT4 has been having me write a hundred variations of scripts, but not a single one addresses the "this isn't plain text" problem.
How would you go about doing find-replace of a text string in a PDF at scale (on Mac)?