Change words and fonts in a print file, at the same place and size
Seshat now changes words in a finished print file and sets all text of one font in another font from its open-licence library, at the same place and size, and reports per text what it could not set. Font files are downloadable too.
A customer's file is almost right: the date is wrong, or the shop wants its own font. Seshat can now change it without a new file.
Change words
replace_text finds a text and changes it, at the same place and size. The new words stay in the file's own font when that font has the letters. If it does not, they go into the same font from Seshat's library, or into a font you name. Nothing is ever set in a font nobody chose: when none of those has the letters, the text stays as it was and the answer names the missing letters.
A PDF has no paragraphs, only text at fixed places, so a longer text does not re-wrap. Changing a short line works well; a new paragraph belongs in the design before the PDF is made.
Change a font
replace_font sets all text of one font in a font from the library: "every Arial in Montserrat Bold". The answer says per font how many texts changed and which could not, such as letters the new font lacks or a Type 3 font that the file draws itself. A font the library does not have is refused with the closest names.
Several changes go in one call, in the order you give, as one charge.
Font files for your own tool
An app with its own PDF editor can download any font of the library with its licence (Open Font License, Apache or Ubuntu Font Licence), and set text itself.
For developers
rekhu/core 0.5 for Laravel and @rekhu/core 0.5 for Node: fix() with replace_text and replace_font, fontFile() and fontFileTo(). Code list 1.3.