Skip to content

Adding a transformation to a page that has content linked from a table of contents removes the content from the page #2300

Closed Answered by pubpub-zz
glynam1 asked this question in Q&A
Discussion options

You must be logged in to vote

using add_page you are loosing the link between pages that do exist in the source.
this is the way I propose to do it:

import pypdf
w=pypdf.PdfWriter(clone_from="example.pdf")
for p in w.pages:
    t=pypdf.Transformation().scale(1,1)
    p.add_transformation(t)
w.write("result.pdf")

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by glynam1
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2296 on November 17, 2023 16:19.