How can PyPDF2 read the correct size of a PDF page
Question:
Answers:
A PDF page can have a "viewing rotation" which causes the PDF viewer to rotate the page before showing it.
The viewing rotation for this page is 90 degrees or 270 degrees. Use PyPDF2 to find out the rotation, and swap the width and height if the rotation is 90 or 270.
You can normalise the pages to remove the viewing rotations whilst leaving the PDF visually intact with:
cpdf in.pdf -upright -o out.pdf
A PDF page can have a "viewing rotation" which causes the PDF viewer to rotate the page before showing it.
The viewing rotation for this page is 90 degrees or 270 degrees. Use PyPDF2 to find out the rotation, and swap the width and height if the rotation is 90 or 270.
You can normalise the pages to remove the viewing rotations whilst leaving the PDF visually intact with:
cpdf in.pdf -upright -o out.pdf