# Javascript: TXTextControl.getSupportedPaperSizes Method

> Gets an array of PaperSize structures specifying the names and the size of all currently supported paper sizes.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.getSupportedPaperSizes Method
- **382 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsupportedpapersizes-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsupportedpapersizes-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsupportedpapersizes-method/llms-full.txt

---

### Description

Gets an array of PaperSize structures specifying the names and the size of all currently supported paper sizes.

### Syntax

```javascript
<void> TXTextControl.getSupportedPaperSizes(<RequestPaperSizeCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the names and the size of all currently supported paper sizes. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TXTextControl.getSupportedPaperSizes` in a practical document-editing workflow. It gets an array of PaperSize structures specifying the names and the size of all currently supported paper sizes.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.getSupportedPaperSizes(
    function(paperSize) {
        if (!paperSize) {
            console.warn("No size was returned.");
            return;
        }
        
        console.log("get supported paper sizes result:", paperSize);
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.getSupportedFonts Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getsupportedfonts-method/llms-full.txt)
- **Next:** [Javascript: TXTextControl.getText Method](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/gettext-method/llms-full.txt)
