Hello,
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());
}
}
}
PdfPageAddImage.zip (3.3 MB)
Best regards,
WEBCON Sp. z o.o.