nissl-lab / npoi

a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop.
Apache License 2.0
5.65k stars 1.42k forks source link

Unable to rotate image manually in DOCX #1353

Open constantinje opened 3 months ago

constantinje commented 3 months ago

NPOI Version

File Type

Upload the Excel File

20230913_Le_Rados.docx

Reproduce Steps

Here 's the code

XWPFParagraph para = resultPhoto.Table.GetRow(resultPhoto.Row).GetCell(resultPhoto.Col).GetParagraphArray(0);
para.Alignment = ParagraphAlignment.LEFT;
para.SpacingAfter = 0;
para.SpacingAfterLines = 0;
para.SpacingBefore = 0;
para.SpacingBeforeLines = 0;
para.SpacingBetween = 1;
XWPFRun r = para.CreateRun();
using (MemoryStream ms = new MemoryStream())
{
     //pic.Resize(resized.Width, resized.Height);
     pic.Write(ms);
     ms.Position = 0;
     r.AddPicture(ms, (int)PictureType.PNG, picName, widthEmus, heightEmus);
}

Issue Description

In the resulting file when we try to rotate the picture only the frame is moving