

The time consuming part about this would be that I would have to perform those steps on every pdf that Taxcycle produced. After doing this, the next time the file is opened, it automatically opens with the bookmarks bar visible. I can manually change the default in each individual pdf file such that the bookmark bar does open with the file in future, but I need to make that change using something like Adobe Acrobat ("File–>Properties->Initial View->Layout and Magnification–>Navigation Tab and change that from “Page Only” to “Bookmarks Panel and Page”) and then save each individual file. You are correct in your understanding that when I open a pdf file (T1 or T2) that has been created by Taxcycle, the side panel containing the bookmarks appears to be totally missing from the rendering as if a default is set somewhere to not have the bookmarks display on open. With regard to the “bookmark” issue I have sent you an email containing a T1 pdf attachment. Thank you for your reply Elizabeth, and thank you for quickly addressing the issue with the zoom. This behavior seems only to be happening with PDF files created with Taxcycle. I can’t say whether this started happening when I downloaded the updated version today or whether it was like that for a while. I can’t see as well as I did 10 years ago. Unfortunately, as soon as you click on any of the bookmarks the pages shrink to about 75% (fit to page) even though I have all my readers set to 125% magnification. Only after saving, closing and and re-opening the file do the Bookmarks now work (in any pdf viewer).Īfter all this, the file now opens fine with the bookmarks being displayed. In order to have the bookmarks display in any of my PDF viewers, I need to open the newly created Taxcycle PDF file in Adobe Acrobat, select "File–>Properties->Initial View->Layout and Magnification–>Navigation Tab and change that from “Page Only” to “Bookmarks Panel and Page”. I believe I have the correct PDF printer selected (Adobe PDF - Bookmarks) according to the above, however, my PDF renderings do not automatically show any of the bookmarks. It seems I have a bit of a different issue with Taxcycle PDF files. However, note that you will overwrite and lose some values if there are multiple bookmarks on the same page (dictionary keys must be unique).Thank you for the “Adobe PDF - Bookmarks” printer description in the list of Taxcycle printers Cam. Print(bookmark_dict(reader.getOutlines()))

#Print bookmarks list pdf code
Modified code to create your desired dictionary: import PyPDF2 There is a getDestinationPageNumber method to get page numbers from Destination objects. I tried with a few files, and the page attribute of a Destination object is always an instance of IndirectObject, which doesn't seem to contain any information about page number.
#Print bookmarks list pdf how to
I don't know how to retrieve the page numbers. # recursive call with increased indentation


This sample code will display bookmarks recursively as an indented table of contents: import PyPDF2 The parent/child relationships are preserved by having the lists nested in each other.
