We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert new Page and ignore the rotation


Is there a way to add a rotated image to an existed pdf and ignore the rotation, than save the document ??

Thank you in advanced

Hi Hiba,

Thanks for using our products and sorry for this delayed response.

As per my understanding, you need to rotate an image file and then you need to add the rotated image to PDF document. If so is the case, then please try using the following code snippet.


Bitmap source_image = new


// save the rotated image in Stream object

MemoryStream stream = new MemoryStream();

source_image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);

//create PdfFileMend object to add text

PdfFileMend mender = new PdfFileMend();

// bind the source PDF file


//add image in the PDF file

mender.AddImage(stream, 1, 100, 600, 200, 700);

//save the PdfFileMend object




No actually i’m trying to save the document with no rotations at all. If the inserted image is originally rotated i need to save it without rotation.

Hi Hiba,

In case the image inserted in PDF is rotated, you may first consider rotating the respective PDF page and then save the document. Please try using the following code snippet to rotate the page of PDF file.


Document doc = new

// rotate first page to 90 degree

doc.Pages[1].Rotate = Rotation.on90;

// save updated document