In Qoppa’s PDF libraries, the page width and page height are returned in points at 72 dpi. Here are the simple formulas to convert the page size to inches, centimeters and millimeters.

// open PDF document
PDFImages pdfDoc = new PDFImages ("C:\\myfile.pdf", null);
 
// loop through pages
for (int count = 0; count < pdfDoc.getPageCount(); ++count)
{
 // this is the cropped page size in points at 72 dpi
 double pageWidth = pdfDoc.getDisplayWidth(count);
 double pageHeight = pdfDoc.getDisplayHeight(count);
 
 System.out.println("*** Page " +  (count+1) + " ******");
 
 System.out.println("*************************");
 System.out.println("Page Size in Points at 72 dpi");
 System.out.println("Page width " + pageWidth + "pt");
 System.out.println("Page height " + pageHeight + "pt");
 
 
 // size of the page in inches
 System.out.println("*************************");
 System.out.println("Page Size in Inches");
 System.out.println("Page width in inches " + pageWidth / 72.0 + "in");
 System.out.println("Page height in inches " + pageHeight / 72.0 + "in");
 
 // size of the page in centimeters
 System.out.println("*************************");
 System.out.println("Page Size in Centimeters");
 System.out.println("Page width " + pageWidth * 2.54 / 72.0 + "cm");
 System.out.println("Page height " + pageHeight * 2.54 / 72.0 + "cm");
 
 // size of the page in millimeters
 System.out.println("*************************");
 System.out.println("Page Size in Millimeters");
 System.out.println("Page width " + pageWidth * 2.54 / 72.0 * 100 + "mm");
 System.out.println("Page height " + pageHeight * 2.54 / 72.0 * 100 + "mm");
 System.out.println("*************************");

Sample output for a Letter Size Page:

*************************
Page Size in Points at 72 dpi
Page width 612.0pt
Page height 792.0pt
*************************
Page Size in Inches
Page width in inches 8.5in
Page height in inches 11.0in
*************************
Page Size in Centimeters
Page width 21.59cm
Page height 27.94cm
*************************
Page Size in Millimeters
Page width 2159.0mm
Page height 2794.0mm
*************************