I have a PDF file which I removed some pages from it. I want to correct(fix) the new pdf page numbers. Is there any way/library to update the page numbers without converting the pdf to another format? I have tried to convert the pdf to text, XML, and JSON and then fix the page number. However, if I convert it back to pdf, it looks messy(cannot keep the style of the original pdf). The problems I have are:
- Removing the old page numbers.
- Adding new page numbers.
I am using python on Ubuntu. I have tried ReportLab, PyX, and pyfpdf.