Skip to content
Discussion options

You must be logged in to vote

I hope this is what you mean:

src = fitz.open("input.pdf")
out = fitz.open()  # the output document
for src_page in src:  # iterate over input pages
    prect = src_page.rect  # page rectangle
    # make empty output page
    out_page = out.new_page(width=prect.width, height=prect.height)  # same size as input page
    # compute rectangle for miniature input page
    prect /= 4  # has width / height 1 quarter of original
    out_page.show_pdf_page(prect, src, src_page.number)
out.ez_save("output.pdf")  # save output file

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@EthanC-8
Comment options

@JorjMcKie
Comment options

Answer selected by EthanC-8
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
Labels
None yet
2 participants