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

Free Support Forum - aspose.com

Struggling with rotating pdf pages

Hello Aspose. I’m struggling with something that I had hoped should be a very easy thing to do… and I’m sure it’s just me!

I have a PDF that was produced by a scanner, so each page contains just an A4 sized image. When the user opens the PDF they see all pages in Portrait so they’re easy to read.

However, when I open the PDF with Aspose and I loop through the pages I see that each Page is actually rotated by 270 degrees. So I assume that the scanner was used to scan all pages in landscape and then, because that would present all pages “sideways” to the user, it was rotated 270 degrees to show them “the right way up”.

This is wreaking havoc with the functionality we are trying to implement as what the user perceives as the “left”, “right”, “top” and “bottom” of the page is actually not. And if we try to insert text in the “footer” of the page it actually appears as “rotated” text in the top right hand corner.

So what we would like to do is process the PDF, make sure all pages are rotated “0 degrees” but when a user opens the resulting PDF they will still see all the pages presented in portrait, i.e. the “right way up” for a reader.

That’s the bit I’m struggling with. I thought we had a “simple” solution by first converting the document to .docx and then back again to .pdf - it is great WHEN it works (but see Images saved as red X when saving .pdf as .docx ) because when it works, the resulting PDF is exactly what we want. Still presented as Portrait pages but now all pages have a 0 degree (“none”) rotation.

What I’m hoping for is a better way to achieve this without having to convert to .docx and back. But I’m struggling to figure out how, plus even if I did I think I may come up with a solution that is unnecessarily inefficient so a bit of help here would be greatly appreciated.


We have responded to your other referred post as well for the sample file. Furthermore, we request you to share sample source PDF document and sample code snippet which you are using to add text in the footer of each page. We will surely investigate the scenario in our environment and provide our feedback accordingly.