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.

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

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

PageSize GetPageSize(String InputFileName, int Page) throws PDFProcessorException

Where PageSize is a utility class:

public class PageSize
   public double width;
   public double height;


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)