We want to insert multiple images or text into page with rotation (adding images to page without rotation is always correct). First attempt to add image to page with rotation is also correct. Every further effort finishes with image placed in other place and image rotation.
We attach simple sample project where the problem occurs (with latest avaible Aspose.PDF 18.5).
Here is sample code:
using (var document = new Aspose.Pdf.Document(fileName))
{
using (var image = new MemoryStream())
{
var bitmap = new Bitmap(32, 32);
Graphics.FromImage(bitmap).FillRectangle(Brushes.Red, 0, 0, bitmap.Width, 10);
Graphics.FromImage(bitmap).FillRectangle(Brushes.Yellow, 0, 11, bitmap.Width, 10);
Graphics.FromImage(bitmap).FillRectangle(Brushes.Green, 0, 22, bitmap.Width, 10);
bitmap.Save(image, ImageFormat.Bmp);
document.Pages[1].AddImage(image, new Aspose.Pdf.Rectangle(10, 10, 42, 42));
using (var saveStream = new MemoryStream())
{
document.Save(saveStream);
File.WriteAllBytes(fileName + "_out.pdf", saveStream.ToArray());
}
}
}
The code snippet is adding an image without any rotation and works fine as mentioned by you. Please share the code that you are using to rotate contents on 90, 180 and 270 degrees, as in the PDF files shared by you. Moreover, you can also add images to a page by adding an image stamp. In case the problem is reproduced by using already shared project, then please mention the steps of execution so that we may try to reproduce and investigate it further.
Thank you for elaborating the steps to reproduce the problem.
We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFNET-44776 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.
We are afraid currently there are no updates regarding this issue. However, we have recorded your concerns and will let you know as soon as any further update will be available.