diff --git a/PdfSharpCore/Pdf.Advanced/PdfFormXObject.cs b/PdfSharpCore/Pdf.Advanced/PdfFormXObject.cs index 3a041ca9..3e18d762 100644 --- a/PdfSharpCore/Pdf.Advanced/PdfFormXObject.cs +++ b/PdfSharpCore/Pdf.Advanced/PdfFormXObject.cs @@ -212,9 +212,9 @@ internal PdfFormXObject(PdfDocument thisDocument, PdfImportedObjectTable importe // Translate the image such that its center lies on the center of the rotated bounding box double offset = (height - width) / 2; - if (height > width) + if (rotate == 90) matrix.TranslatePrepend(offset, offset); - else + else if (rotate == -90) matrix.TranslatePrepend(-offset, -offset); //string item = "[" + PdfEncoders.ToString(matrix) + "]";