# GC.Spread.Sheets.Print.PaperSize

## Content

# Class: PaperSize

[Sheets](../modules/GC.Spread.Sheets).[Print](../modules/GC.Spread.Sheets.Print).PaperSize

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.Print.PaperSize#constructor)

### Methods

- [getPageSize](GC.Spread.Sheets.Print.PaperSize#getpagesize)
- [height](GC.Spread.Sheets.Print.PaperSize#height)
- [kind](GC.Spread.Sheets.Print.PaperSize#kind)
- [width](GC.Spread.Sheets.Print.PaperSize#width)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new PaperSize**(`widthOrKind?`, `height?`)

Specifies the paper size.<br/>
The constructor has 3 modes.<br/>
If there are 2 parameters, the parameters are width and height with a type of number;<br/>
If there is 1 parameter, the parameter is kind which is a GC.Spread.Sheets.Print.PaperKind type;<br/>
If there is no parameter, the result is the same as the second mode and the kind option is GC.Spread.Sheets.Print.PaperKind.letter.

**`example`**
```
var printInfo = new GC.Spread.Sheets.Print.PrintInfo();
printInfo.pageHeaderFooter({
    normal: {
        header: {
            left: "Header Left"
        }
    }
});
printInfo.paperSize(new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4));
spread.print(0);
```

#### Parameters

| Name | Type |
| :------ | :------ |
| `widthOrKind?` | `number` |
| `height?` | `number` |

## Methods

### <a id="getpagesize" name="getpagesize"></a> getPageSize

▸ **getPageSize**(`kind`): [`PrintSize`](../interfaces/GC.Spread.Sheets.Print.PrintSize)

Gets the paper size, in hundredths of an inch.

**`example`**
```
var paperSize = new GC.Spread.Sheets.Print.PaperSize();
console.log(paperSize.getPageSize(GC.Spread.Sheets.Print.PaperKind.a4)); // Get the size of a4 paper.
console.log(paperSize.getPageSize(GC.Spread.Sheets.Print.PaperKind.a5)); // Get the size of a5 paper.
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `kind` | [`PaperKind`](../enums/GC.Spread.Sheets.Print.PaperKind) | The kind of the paper. |

#### Returns

[`PrintSize`](../interfaces/GC.Spread.Sheets.Print.PrintSize)

The size which contains width and height of the paper.

___

### <a id="height" name="height"></a> height

▸ **height**(`value?`): `any`

Gets or sets the height of the paper, in hundredths of an inch.

**`example`**
```
var paperSize = new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4);
var height = paperSize.height(); // Get the height of the paper.
paperSize.height(height / 2); // Set the height of paper.
```

#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | `number` |

#### Returns

`any`

If no value is set, returns the height of the paper; otherwise, returns the paper size.

___

### <a id="kind" name="kind"></a> kind

▸ **kind**(`value?`): `any`

Gets or sets the kind of the paper.

**`example`**
```
var paperSize = new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4);
console.log(paperSize.kind()); // Get the kind of the paper.
paperSize.kind(GC.Spread.Sheets.Print.PaperKind.a5); // Set the kind of paper.
```

#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | [`PaperKind`](../enums/GC.Spread.Sheets.Print.PaperKind) |

#### Returns

`any`

If no value is set, returns the kind of the paper; otherwise, returns the paper size.

___

### <a id="width" name="width"></a> width

▸ **width**(`value?`): `any`

Gets or sets the width of the paper, in hundredths of an inch.

**`example`**
```
var paperSize = new GC.Spread.Sheets.Print.PaperSize(GC.Spread.Sheets.Print.PaperKind.a4);
var width = paperSize.width(); // Get the width of the paper.
paperSize.width(width / 2); // Set the width of paper.
```

#### Parameters

| Name | Type |
| :------ | :------ |
| `value?` | `number` |

#### Returns

`any`

If no value is set, returns the width of the paper; otherwise, returns the paper size.
