pyfpdf
pyfpdf copied to clipboard
Adding TOC shifts pages and messes with page orientation
Hi,
I'm creating a pdf document with a table of content adapted from the attic/TOC.py script. It's all working well expect that I run into a problem when my pages have different page orientation. It seems that moving the TOC to the first page shifts all the document by the number of pages needed for the TOC. At the end I end up with wrong page orientations.
For example, let's say my last page is set up as orientation="L". If I have a TOC of one page, it will be moved at the begining of the document and will shifts my pages. At then end, I will have a landscaped penultimate page and a portrait last page.
How can I resolve this? Is there a way to move the whole page for the TOC instead of just moving the contents? Thank you for your help!
PyFPDF is not maintained anymore, you may want to check PyFPDF/fpdf2 as its successor, with a 99%-compatible API