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

Free Support Forum - aspose.com

Check whether a page in a sample is rotated

I am currently using aspose.pdf, aspose.imaging, aspose.words for java.
Is there any option to check whether the input image sample is rotated or not?
like is there any option to find if the image is rotated from its original form.
If so please let me know.

I have attached a sample hereā€¦
In this sample Page 12 and 13 are of different orientation (rotated) . Due to this we are facing an issue. Is there a way to check whether the page is rotated or not so that if it is rotated, we can make it normal for the next process to take place.
ThankyoutestSample.pdf (4.5 MB)

We are trying to take OCR in this sample. As the page 12 and 13 are rotated, we are not able to do so. So is it possible to know if the page is rotated base on the text present in the page or any other way so that we can rotate it again for the next process to continue


The page rotation can be detected using Page.Rotate property. Please check the following code snippet:

Document doc = new Document(dataDir + "testSample.pdf");
foreach(var page in doc.Pages)
 Console.WriteLine("Page #:" + page.Number + " is rotated on " + page.Rotate);

The API is able to detect the rotation angle of rotated pages and it seems like the Pages 12 and 13 are not rotated.