Change the font in a PDF file

I have a repository of PDF documents, and most of the text contained in these documents is formatted in Comic Sans. I would like to change this to something similar to Arial. The original font is embedded in the document. I have not found any existing tool for this (I am on Linux), and I am wondering if it is possible to do this programmatically. A Python library would be ideal, but a library in any programming language could work.

In which library can I replace fonts with minimal effort? And what parts of the API would I use?

+4
source share
1 answer

There are commercial tools that can do this - one of them is pdfToolbox from callas software (warning - I'm associated with this company).

However, despite the fact that this function exists and is sometimes used, the results are often completely undesirable, and I have not seen many contexts where it is used for more than certain files. And usually with limited success. By the time this replacement is available only in manual mode in the said tool, and not in automatic mode.

Depending on how complex these files are, you will probably have better success in extracting all the text from the documents into something like RTF, perform any manipulations you need to do, and subsequently restore the PDF. It sounds like a roundabout way, but I assume that in most cases the result will be better ...

+1
source

All Articles