Skip to content

Ability to mirror PDF pages #4822

@rrthomas

Description

@rrthomas

Describe the solution you'd like

When calling Page.show_pdf_page it's currently possible to perform various operations on the inserted page (specifically, the page can be translated and scaled, via the rect argument, and rotated, via the rotate argument`), but I can't see any way to apply arbitrary transforms.

Describe alternatives you've considered

I can't see another way to do this, other than by rendering the PDF and transforming the render.

Additional context

I'm the maintainer of PSUtils, a PostScript and PDF document manipulator. It currently uses PyPDF to work with PDF files. I would like to use PyMuPDF instead for better performance.

It was pretty easy to rework PSUtils to use PyMuPDF, and I have almost the entire test suite passing, but one of the remaining failures is for horizontally and vertically mirroring pages, which I realise, at this late stage, that MuPDF seems not to be able to do.

I'm a bit surprised! Maybe I overlooked something? But I have looked at the C API too and I can't find a way to do it, so maybe it's an upstream problem.

In any case, it's easy to do in PyPDF, so I don't suppose this is a limitation of PDF itself.

Thanks for MuPDF! I hope to be able to use it eventually.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions