xpdfSpliceGetPageRotation
Get the default rotation for an input page.
int xpdfSpliceGetPageRotation(XpdfSpliceInputHandle in, int page)
This function returns the default rotation, in degrees, of the
specified page. The rotation will be one of: 0, 90, 180, or 270.
PDF pages can be rotated to landscape mode in two ways:
- page width less than page height; and rotation of 90 or 270
- page width greater than page height; and rotation of 0 or 180
C:
XpdfSpliceInputHandle in;
double width, height;
int rot;
in = xpdfSpliceOpenInput("c:/test/file.pdf");
width = xpdfSpliceGetPageWidth(in, 1);
height = xpdfSpliceGetPageWidth(in, 1);
rot = xpdfSpliceGetPageRotation(in, 1);
if (((rot == 90 || rot == 270) && width < height) ||
((rot == 0 || rot == 180) && width > height)) {
/* page is landscape mode */
} else {
/* page is portrait mode */
}