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

GetPaperSize Method

Gets a paper size identifier value from a given paper name.

Function GetPaperSize(PaperName As String) As Long

int GetPaperSize(string PaperName)

int GetPaperSize(String PaperName) throws PrinterException


Return Values

A paper size identifier for the specified paper.


The value returned from this method can be used to set the LayoutPaperSize property setting. This method is intended to be used for retrieving the identifier value for custom paper sizes. Use one of the values from prnPaperSize instead if the paper size you need is defined there.

This method will fail if the paper name you specified does not exist.

Example Usage

Set oPrinter = CreateObject("easyPDF.Printer.8")
Set oSetting = oPrinter.PrinterSetting
oSetting.CreatePaper "My Custom Paper", 10.0, 10.0
If oSetting.IsPaperAvailable("My Custom Paper") Then
    oSetting.LayoutPaperSize = oSetting.GetPaperSize("My Custom Paper")
End If