So you want to modify the text of a PDF by hand (2020)

If you’re tired of spending money on commercial PDF tools, the author shares a solution for changing the text content of a PDF without paying for Adobe Acrobat or other PDF tools. They discovered some useful facts about the structure of PDFs that may be helpful to others. The author explains how to view compressed text data using a command line tool, and how to find and read the decompressed text in a text editor. They note that the text is encoded and suggest using the pdffonts tool to identify the fonts associated with embedded encodings. They also explain how to find the embedded encoding table for a specific font and provide an example of the table format. The author uses Python to automate the translation process and replace the desired text. Overall, they offer a Mac-oriented guide to modifying PDF text using open-source tools available on most Linux distributions.

https://gist.github.com/senderle/8ad6aae251c4ddf9424f8a05dd0e8c18

To top