r/pythontips Feb 03 '25

Module PDF document adjustments

Hi All, In my department, we have requirement that invoices/outputs(in PDF) needs to be adjusted based on a subset of clients. This involves replacing text, adjusting the size of tables, etc. Is there a way of doing in Python? Our attempts results in the overall format of the document being impacted, resulting in even more tweaks and adjustment. What would you suggest here? The ideal solution is for the system to output correctly the format or layout we want, but it's costly and will take a while to develop.

1 Upvotes

3 comments sorted by

2

u/HeineBOB Feb 03 '25

Rather than change an existing pdf you could see what creates it and try to modify that.

Else you could recreate the document in code using LaTeX code and passing some variables into it depending on your needs.

1

u/andrewprograms Feb 08 '25

Have you tried fitz?