Fix handling of pages that are restored to correct orientation with /Rotate

Appears inversion of CTM was incorrect, introduced in commit 9898904
This commit is contained in:
James R. Barlow
2024-02-12 01:32:26 -08:00
parent 26470fe16a
commit 42ff7fc842
3 changed files with 58 additions and 30 deletions
+2 -3
View File
@@ -289,9 +289,8 @@ class OcrGrafter:
# Translate the text so it is centered at (0, 0), rotate it there, adjust
# for a size different between initial and text PDF, then untranslate, and
# finally move the lower left corner to match the mediabox. All transforms
# must be premultiplied so they are applied in reverse order here.
ctm = corner @ untranslate @ scale @ rotate @ translate
# finally move the lower left corner to match the mediabox.
ctm = translate @ rotate @ scale @ untranslate @ corner
log.debug("Grafting with ctm %r", ctm)
base_resources = _ensure_dictionary(base_page.obj, Name.Resources)