Hi folks i have a few use cases i need to cover while rotating the page in the PDF .
I need to check each page rotation value and rotate it to 0 degree.
when i check few docs in Adobe it shows me 90 degree but it will be in 0 degree.
I need to cover both the use cases, I have written a code using java PDFBox which will get the degree of rotation is showing wrong, If any one have idea How to find And what are the Aspects that decide the degree please help me through it . with code or Wiki to refer , I am working on a spring boot project.
PDDocument document;
public void getPdfFile(String pdfPath) throws IOException {
File file = new File(pdfPath);
document = PDDocument.load(file);
int pageCount = document.getNumberOfPages();
for(int i = 0; i < pageCount; i++) {
PDPage page = document.getPage(i);
System.out.println( page.getRotation());
if(page.getRotation() != 0) {
page.setRotation(0);
}
}
document.save("/Users/tejasreddy/Desktop/CE/StorePDF/rotated1_rotated.pdf");
document.close();
}
Thanks Tejas.