Skip to content

Get the transformation applied to an image #335

Closed
@julamb

Description

@julamb

Hi. Thanks for a great library with loads of documentation and examples!

I'm trying to follow this example to extract images from a pdf: https://github.com/pymupdf/PyMuPDF/wiki/How-to-Extract-Images-from-a-PDF

My issue is, in some PDFs that are scans of a document, the images seems to be rotated (the export is rotated 90° compared to what I see in the .pdf). I've researched the subject a little and it looks like I could apply the inverse rotation if I could access the transformation matrix (ctm) of every image, but could not find a way to get it from either the xref or the pixmap object. Any hints?

Thanks a lot!
Julien

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions