diff --git a/src/Document/ContentStream/ContentStream.php b/src/Document/ContentStream/ContentStream.php index a74887a6..1c120bd0 100644 --- a/src/Document/ContentStream/ContentStream.php +++ b/src/Document/ContentStream/ContentStream.php @@ -39,8 +39,8 @@ public function getPositionedTextElements(Page|XObject $context, TransformationM foreach ($this->content as $content) { if ($content instanceof ContentStreamCommand) { if ($content->operator === GraphicsStateOperator::SaveCurrentStateToStack) { - $transformationStateStack[] = clone $transformationMatrix; - $textStateStack[] = clone $textState; + $transformationStateStack[] = $transformationMatrix; + $textStateStack[] = $textState; } elseif ($content->operator === GraphicsStateOperator::RestoreMostRecentStateFromStack) { $transformationMatrix = array_pop($transformationStateStack) ?? throw new ParseFailureException();