# PDF export

PDF export fixes the table into a shareable document. Choose CSV or XLSX for further calculation in other apps, and PDF for reading and distribution.

Canonical: https://grid.syidax.com/docs/features/pdf-export/

<a id="understand"></a>

## How it works and when to use it

Korean and other CJK characters require a supporting font. Provide a hosted TTF/OTF URL or explicit fontBytes rather than relying only on access to local browser fonts.

Using this feature in a product requires the Pro package and a valid license. Matching setting names do not enable Pro features in Community.

In the code, grid is the Grid element prepared in the installation chapter. Check each example's data and settings, and implement the app functions and server endpoints for your project.

- [Installation and integration · Shared sample data](https://grid.syidax.com/docs/guides/getting-started.md)

<a id="example-1"></a>

## Example 1. Connect a Korean font

Replace the URL below with the path to a font file your app actually hosts.

```javascript
grid.pdfFontUrl = '/fonts/NotoSansKR-Regular.ttf';
await grid.exportDataAsPdf({ fileName: 'orders.pdf' });
```

Verify the result: Inspect the generated PDF to ensure Korean titles and values do not appear as missing-glyph squares.

<a id="example-2"></a>

## Example 2. Inspect results before downloading

Get the PDF result object without downloading.

```javascript
const result = await grid.getDataAsPdf();
console.log(result);
```

Verify the result: Handle the result according to PdfExportResult. Do not assume it has the same type as a string or XLSX bytes.

<a id="example-3"></a>

## Example 3. Reading order in wide tables

Choose columns and page options in SyGridPdfExportOptions. Review samples containing long product names, Korean text, negative numbers, empty values, and multiple pages.

Verify the result: In a PDF viewer, check that headers and data remain readable across page boundaries and required columns are not clipped. Document export differs from a screenshot.

<a id="pitfalls"></a>

## Combining features and troubleshooting

Configure font URL access, CORS, and licensing in your app. Do not use development-only paths in deployed documents.

Also test environments where automatic font discovery fails, and explain errors or alternatives to the user.

<a id="related-api"></a>

## APIs used by this feature

- [pdfFontUrl](https://grid.syidax.com/docs/options/pdfFontUrl.md) — An app-hosted TTF/OTF URL for characters absent from the default PDF font, such as Korean characters.
- [pdfAutoFont](https://grid.syidax.com/docs/options/pdfAutoFont.md) — Automatically resolves a PDF font when fontBytes is absent. Tries pdfFontUrl first, then local font access where available.
- [getDataAsPdf](https://grid.syidax.com/docs/methods/getDataAsPdf.md) — Returns PDF generation results without downloading. Prepare a suitable font for characters such as Korean text.
- [exportDataAsPdf](https://grid.syidax.com/docs/methods/exportDataAsPdf.md) — Downloads the table as PDF and returns generation results.

<a id="next"></a>

## Related reading

- [How rows, columns, and IDs relate](https://grid.syidax.com/docs/guides/concepts.md)
- [Connect results and events](https://grid.syidax.com/docs/guides/data-event-access.md)
- [Explore in Features](https://grid.syidax.com/grid/pdf-export) — The guide describes which interactions are available to try.
