Skip to content

Commit 01acefd

Browse files
committed
detect page rotation and use it for the image appearance
1 parent 38321bb commit 01acefd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PDFDoc.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ protected function _generate_signature_in_document() {
366366
$page_obj["Annots"] = new PDFValueList();
367367

368368
$annots = &$page_obj["Annots"];
369+
$page_rotation = $page_obj["Rotate"]??0;
369370

370371
if ((($referenced = $annots->get_object_referenced()) !== false) && (!is_array($referenced))) {
371372
// It is an indirect object, so we need to update that object
@@ -455,7 +456,7 @@ protected function _generate_signature_in_document() {
455456
"Resources" => new PDFValueObject()
456457
]);
457458

458-
$result = _add_image([$this, "create_object"], $imagefilename, ...$bbox);
459+
$result = _add_image([$this, "create_object"], $imagefilename, $bbox[0], $bbox[1], $bbox[2], $bbox[3], $page_rotation->val());
459460
if ($result === false)
460461
return p_error("could not add the image");
461462

0 commit comments

Comments
 (0)