SpreadJS 13
GC.Spread.Sheets.Print Namespace / PrintInfo type / paperSize Method
The paper size for printing.
The width, in hundredths of an inch.
The height, in hundredths of an inch.
@returns {GC.Spread.Sheets.Print.PaperSize | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the paper size for printing; otherwise, returns the print setting information.
In This Topic
    paperSize Method
    In This Topic
    Gets or sets the paper size for printing.
    Syntax
    var instance = new GC.Spread.Sheets.Print.PrintInfo();
    var returnValue; // Type: any
    returnValue = instance.paperSize(value, value.width, value.height, null);
    function paperSize( 
       (optional) value : PaperSize,
       (optional) value.width : number,
       (optional) value.height : number,
       null : any
    ) : any;

    Parameters

    value
    The paper size for printing.
    value.width
    The width, in hundredths of an inch.
    value.height
    The height, in hundredths of an inch.
    null
    @returns {GC.Spread.Sheets.Print.PaperSize | GC.Spread.Sheets.Print.PrintInfo} If no value is set, returns the paper size for printing; otherwise, returns the print setting information.
    Example
    The following examples set the paper size.
    activeSheet.setRowCount(3, GC.Spread.Sheets.SheetArea.viewport);
    activeSheet.setColumnCount(3, GC.Spread.Sheets.SheetArea.viewport);
    
    activeSheet.suspendPaint();
                //set value
                for (var r = 0, rc = activeSheet.getRowCount(); r < rc; r++) {
                    for (var c = 0, cc = activeSheet.getColumnCount(); c < cc; c++) {
                        activeSheet.setValue(r, c, r + c);
                    }
                }
    activeSheet.resumePaint();
    
    $("#button1").click(function () {
    var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
    printInfo.headerLeft("Header Left");
    printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4));
    spread.print(0);
       });
    activeSheet.setRowCount(3, GC.Spread.Sheets.SheetArea.viewport);
    activeSheet.setColumnCount(3, GC.Spread.Sheets.SheetArea.viewport);
    
    activeSheet.suspendPaint();
                //set value
                for (var r = 0, rc = activeSheet.getRowCount(); r < rc; r++) {
                    for (var c = 0, cc = activeSheet.getColumnCount(); c < cc; c++) {
                        activeSheet.setValue(r, c, r + c);
                    }
                }
    activeSheet.resumePaint();
    
    $("#button1").click(function () {
    var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
    printInfo.headerLeft("Header Left");
    printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(300, 300));
    spread.print(0);
       });
    See Also

    Reference

    PrintInfo type