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

GetPageSizeVar Method

Gets page width and height information from a PDF file.

Note: This function was designed for Java, VBScript and classic ASP. For C++, C# and VB.NET the GetPageSize() method is easier to use.
This function does not exist in native .NET and native Java. Please use GetPageSize() instead.

Sub GetPageSizeVar(InputFileName As String,
                   Page As Long,
                   Width As Variant,
                   Height As Variant)


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 (VBScript)

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

Example Usage (Java with the JACOB bridge)

import com.bcl.easypdf.*;
import com.bcl.easypdf.EasyPDFProcessor.*;
import com.jacob.com.*;


IPDFProcessor pcr = new IPDFProcessor();
Variant varwidth = new Variant(0.0, true);
Variant varheight = new Variant(0.0, true);
// note: the second "true" argument means pass the variant by reference
pcr.GetPageSizeVar(inputFileName, pageNo, varwidth, varheight);
double width = varwidth.getDouble();
double height = varheight.getDouble();