pyfpdf icon indicating copy to clipboard operation
pyfpdf copied to clipboard

Adding TOC shifts pages and messes with page orientation

Open amauryavril opened this issue 4 years ago • 1 comments

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!

amauryavril avatar Aug 07 '20 12:08 amauryavril

PyFPDF is not maintained anymore, you may want to check PyFPDF/fpdf2 as its successor, with a 99%-compatible API

Lucas-C avatar Sep 01 '21 13:09 Lucas-C