easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

GetPageSize Method

Gets page width and height information from a PDF file.
Warning: This method does not work for Java and scripting languages, such as VBScript and classic ASP. For those languages please use the GetPageSizeVar() method instead.

void GetPageSize(string InputFileName,
                 int Page,
                 out double Width,
                 out double Height)

Sub GetPageSize(InputFileName As String, _
                Page As Integer, _
                ByRef Width As Double, _
                ByRef Height As Double)

def GetPageSize(self, InputFileName, Page) # returns PageSize

class PageSize:
   def __init__(self, width, height):
      self.width = width
      self.height = height
PageSize GetPageSize(String InputFileName,
                     int Page) throws PDFProcessorException
public class PageSize {
   public double width;
   public double height;
function GetPageSize($InputFileName, $Page, &$Width, &$Height) 

BclPrcResult GetPageSize(const BclPDFProcessorSettings* pSettings,
                         const wchar_t* InputFileName,
                         int Page,
                         double* poutWidth,
                         double* poutHeight);

Sub GetPageSize(InputFileName As String, _
                Page As Long, _
                Width As Double, _
                Height As Double)


Return Values



Coordinate system information:

  1. The unit size of PDF user space is 1/72 inch (1 inch = 72 PDF user space unit).
  2. The location of the origin (0, 0) is at top-left corner.

    The page number uses zero-based index, meaning that page number starts from 0.

Example Usage

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
oProcessor.GetPageSize "C:\test\input.pdf", _
                        0, _
                        width, _
MsgBox "Width: " + CStr(width) + ", Height: " + CStr(height)