BCL easyPDF SDK
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(Page As Long,
                Width As Variant,
                Height As Variant)

Parameters

Return Values

N/A.

Remarks

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 in VBScript

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")

Set oProcessorHandle = oProcessor.OpenFile("C:\test\input.pdf", "C:\test\input.pdf")

oProcessorHandle.GetPageSizeVar 0, _
                             width, _
                             height
oProcessorHandle.Close
MsgBox "Width: " + CStr(width) + ", Height: " + CStr(height)

Example Usage in Java with the JACOB bridge

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

...

EasyPDF.initialize();

IPDFProcessor pcr = new IPDFProcessor();
IPDFProcessorHandle handle = pcr.OpenFile(inputFileName, inputFileName, null);

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
handle.GetPageSizeVar(pageNo, varwidth, varheight);
double width = varwidth.getDouble();
double height = varheight.getDouble();
handle.Close();
EasyPDF.uninitialize();