[]
        
(Showing Draft Content)

GC.Spread.Sheets.Print.PrintInfo

Class: PrintInfo

Sheets.Print.PrintInfo

Table of contents

Constructors

Methods

Constructors

constructor

new PrintInfo()

Represents the information to use when printing a Worksheet.

Methods

bestFitColumns

bestFitColumns(value?): any

Gets or sets whether column widths are adjusted to fit the longest text width for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.bestFitColumns(true);
printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape);
printInfo.pageHeaderFooter({
     normal: {
         footer: {
             center: "GrapeCity"
         }
     }
});
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether column widths are adjusted to fit the longest text width for printing; otherwise, returns the print setting information.


bestFitRows

bestFitRows(value?): any

Gets or sets whether row heights are adjusted to fit the tallest text height for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.bestFitRows(true);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether row heights are adjusted to fit the tallest text height for printing; otherwise, returns the print setting information.


blackAndWhite

blackAndWhite(value?): any

Gets or sets whether to print in black and white.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.blackAndWhite(true);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether to print in black and white; otherwise, returns the print setting information.


centering

centering(value?): any

Gets or sets how the printed page is centered.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.columnStart(0);
printInfo.columnEnd(2);
printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PrintCentering

Returns

any

If no value is set, returns how the printed page is centered; otherwise, returns the print setting information.


columnEnd

columnEnd(value?): any

Gets or sets the last column to print when printing a cell range.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.columnStart(0);
printInfo.columnEnd(2);
printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the last column to print when printing a cell range; otherwise, returns the print setting information.


columnStart

columnStart(value?): any

Gets or sets the first column to print when printing a cell range.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.columnStart(0);
printInfo.columnEnd(2);
printInfo.centering(GC.Spread.Sheets.Print.PrintCentering.horizontal);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the first column to print when printing a cell range; otherwise, returns the print setting information.


differentFirstPage

differentFirstPage(value?): any

Gets or sets whether to print the different text and format of the header/footer on first page.

example

var printInfo = activeSheet.printInfo();
printInfo.differentFirstPage(true);
printInfo.pageHeaderFooter({
     first: {
         header: {
             left: "It is &T.",
             center: "&SThis is text.",
             right: "&BHeader"
         }
     }
});
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether to print the different text and format of the header/footer on first page; otherwise, returns the print setting information.


differentOddAndEvenPages

differentOddAndEvenPages(value?): any

Gets or sets whether to print the different text and format of the header/footer on odd and even pages.

example

var printInfo = activeSheet.printInfo();
printInfo.differentOddAndEvenPages(true);
printInfo.pageHeaderFooter({
     odd: {
         header: {
             left: "It is &T.",
             center: "&SThis is text.",
             right: "&BHeader"
         }
     },
     even: {
         header: {
             left: "It is &T.",
             center: "&SThis is text.",
             right: "&BHeader"
         }
     }
});
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether to print the different text and format of the header/footer on odd and even pages; otherwise, returns the print setting information.


firstPageNumber

firstPageNumber(value?): any

Gets or sets the page number to print on the even pages.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.firstPageNumber(1);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the page number to print on the even pages; otherwise, returns the print setting information.


fitPagesTall

fitPagesTall(value?): any

Gets or sets the number of vertical pages to check when optimizing printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.fitPagesTall(1);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the number of vertical pages to check; otherwise, returns the print setting information.


fitPagesWide

fitPagesWide(value?): any

Gets or sets the number of horizontal pages to check when optimizing the printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.fitPagesWide(1);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the number of horizontal pages to check; otherwise, returns the print setting information.


margin

margin(value?): any

Gets or sets the margins for printing, in hundredths of an inch.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left",
             right: "Header Right"
         },
         footer: {
             left: "Footer Left",
             center: "Footer Center",
             right: "Footer Right"
         }
     }
});
printInfo.margin({top:75, bottom:75, left:20, right:20, header:10, footer:20});
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PrintMargins

Returns

any

If no value is set, returns the margins for printing; otherwise, returns the print setting information.


orientation

orientation(value?): any

Gets or sets the page orientation used for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.bestFitColumns(true);
printInfo.orientation(GC.Spread.Sheets.Print.PrintPageOrientation.landscape);
printInfo.pageHeaderFooter({
     normal: {
         footer: {
             center: "GrapeCity"
         }
     }
});
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PrintPageOrientation

Returns

any

If no value is set, returns the page orientation used for printing; otherwise, returns the print setting information.


pageHeaderFooter

pageHeaderFooter(value?): any

Gets or sets options to print the text and format of the custom header/footer on the page.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "It is &T.",
             center: "&SThis is text.",
             right: "&BHeader"
         }
     }
});
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? IPageCustomHeaderFooterOptions

Returns

any

If no value is set, returns the options to print the text and format of the custom header/footer on the page; otherwise, returns the print setting information.


pageOrder

pageOrder(value?): any

Gets or sets the order in which pages print.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageOrder(GC.Spread.Sheets.Print.PrintPageOrder.auto);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PrintPageOrder

Returns

any

If no value is set, returns a value that specifies the order in which pages print; otherwise, returns the print setting information.


pageRange

pageRange(value?): any

Gets or sets the page range for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageRange("1-3");
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? string

Returns

any

If no value is set, returns a string that provides page numbers or page ranges; otherwise, returns the print setting information.}


paperSize

paperSize(value?): any

Gets or sets the paper size for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(300, 300));
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PaperSize

Returns

any


qualityFactor

qualityFactor(value?): any

Gets or sets the quality factor for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.qualityFactor(6);
activeSheet.printInfo(printInfo);
spread.print();

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the quality factor for printing; otherwise, returns the print setting information.


repeatColumnEnd

repeatColumnEnd(value?): any

Gets or sets the last column of a range of columns to print on the left of each page.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.repeatColumnStart(0);
printInfo.repeatColumnEnd(2);
printInfo.repeatRowStart(0);
printInfo.repeatRowEnd(2);
activeSheet.printInfo(printInfo);
spread.print();

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the last column of a range of columns to print on the left of each page; otherwise, returns the print setting information.


repeatColumnStart

repeatColumnStart(value?): any

Gets or sets the first column of a range of columns to print on the left of each page.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.repeatColumnStart(0);
printInfo.repeatColumnEnd(2);
printInfo.repeatRowStart(0);
printInfo.repeatRowEnd(2);
activeSheet.printInfo(printInfo);
spread.print();

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the first column of a range of columns to print on the left of each page; otherwise, returns the print setting information.


repeatRowEnd

repeatRowEnd(value?): any

Gets or sets the last row of a range of rows to print at the top of each page.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.repeatColumnStart(0);
printInfo.repeatColumnEnd(2);
printInfo.repeatRowStart(0);
printInfo.repeatRowEnd(2);
activeSheet.printInfo(printInfo);
spread.print();

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the last row of a range of rows to print at the top of each page; otherwise, returns the print setting information.


repeatRowStart

repeatRowStart(value?): any

Gets or sets the first row of a range of rows to print at the top of each page.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.repeatColumnStart(0);
printInfo.repeatColumnEnd(2);
printInfo.repeatRowStart(0);
printInfo.repeatRowEnd(2);
activeSheet.printInfo(printInfo);
spread.print();

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the first row of a range of rows to print at the top of each page; otherwise, returns the print setting information.


rowEnd

rowEnd(value?): any

Gets or sets the last row to print when printing a cell range.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.rowStart(0);
printInfo.rowEnd(2);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the last row to print when printing a cell range; otherwise, returns the print setting information.


rowStart

rowStart(value?): any

Gets or sets the first row to print when printing a cell range.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
     normal: {
         header: {
             left: "Header Left"
         }
     }
});
printInfo.rowStart(0);
printInfo.rowEnd(2);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns the first row to print when printing a cell range; otherwise, returns the print setting information.


showBorder

showBorder(value?): any

Gets or sets whether to print an outline border around the entire control.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.showBorder(false);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether to print an outline border around the entire control; otherwise, returns the print setting information.


showColumnHeader

showColumnHeader(value?): any

Gets or sets whether to print the column header.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.showColumnHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PrintVisibilityType

Returns

any

If no value is set, returns whether to print the column header; otherwise, returns the print setting information.


showGridLine

showGridLine(value?): any

Gets or sets whether to print the grid lines.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.showGridLine(false);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether to print the grid lines; otherwise, returns the print setting information.


showRowHeader

showRowHeader(value?): any

Gets or sets whether to print the row header.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.showRowHeader(GC.Spread.Sheets.Print.PrintVisibilityType.hide);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? PrintVisibilityType

Returns

any

If no value is set, returns whether to print the row header; otherwise, returns the print setting information.


useMax

useMax(value?): any

Gets or sets whether to print only rows and columns that contain data.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.useMax(true);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? boolean

Returns

any

If no value is set, returns whether to print only rows and columns that contain data; otherwise, returns the print setting information.


watermark

watermark(value?): IWatermarkItem

Gets or set all watermark.

example

// This example shows how to set watermark.
var printInfo = activeSheet.printInfo();
printInfo.watermark([{x:0, y:0, width:100, height:100, imageSrc:".image/watermark.jpg", page:"all"}]);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? IWatermarkItem[]

Returns

IWatermarkItem

The watermark item.


zoomFactor

zoomFactor(value?): any

Gets or sets the zoom factor used for printing.

example

var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.zoomFactor(2);
activeSheet.printInfo(printInfo);
spread.print(0);

Parameters

Name Type
value? number

Returns

any

If no value is set, returns a value that specifies the amount to enlarge or reduce the printed worksheet; otherwise, returns the print setting information.