# Introduction

Source: https://sdk.pdf.net/docs/v1



The SDK is a React library for building PDF applications in the browser: viewers, editors, form fillers, and the tools in between. It is built around one idea: the SDK owns the document, and you own the UI.

The main component, `Viewport`, renders the pages and handles direct interaction with them (scrolling, zooming, selecting, typing, filling form fields). Everything around it, such as toolbars, sidebars, and shortcuts, is your own React code that drives the SDK through hooks: hooks that read document state re-render your components when that state changes, and hooks that return commands let you change the document.

> **Beta**: the SDK is in beta, and the exports and their APIs may change freely between releases. Pin the exact package version and review the changes when updating.

## Where to start [#where-to-start]

* [Getting started](https://sdk.pdf.net/docs/v1/guides/getting-started): install the package from the private registry, set up `PdfProviders`, load a document, and render the `Viewport`.
* [Building a PDF application](https://sdk.pdf.net/docs/v1/guides/building-a-pdf-application): how the main view, the toolbar, the sidebars, and the selection toolbar map to the SDK's API.
* [Working with forms](https://sdk.pdf.net/docs/v1/guides/working-with-forms): read and fill form fields, and build a form sidebar.
* [Programmatic editing](https://sdk.pdf.net/docs/v1/guides/programmatic-editing): read and change document text from code, without user interaction.
* [Theming and customization](https://sdk.pdf.net/docs/v1/guides/theming-and-customization): attach your class names and styles to the SDK's elements, or replace them with your own components.
* [Error handling and logging](https://sdk.pdf.net/docs/v1/guides/error-handling-and-logging): the errors the SDK throws and the messages it logs.

## Migration guides [#migration-guides]

* [Migrating from pdf.js](https://sdk.pdf.net/docs/v1/migration/from-pdfjs): replace `getDocument`, canvas rendering, and the `PDFViewer` components with `PdfProviders`, `Viewport`, and hooks.
* [Migrating from Apryse WebViewer](https://sdk.pdf.net/docs/v1/migration/from-apryse): rebuild the WebViewer UI as React components and move `instance.Core` calls to hooks.
* [Migrating from Nutrient Web SDK](https://sdk.pdf.net/docs/v1/migration/from-nutrient): replace `NutrientViewer.load`, the instance API, and the built-in toolbar with `PdfProviders`, `Viewport`, and your own components.
* [Migrating from Foxit PDF SDK for Web](https://sdk.pdf.net/docs/v1/migration/from-foxit): replace `PDFUI` and `PDFViewer` with `Viewport`, and the viewer's states and events with hooks.
* [Migrating from Syncfusion PDF Viewer](https://sdk.pdf.net/docs/v1/migration/from-syncfusion): replace `PdfViewerComponent` and its injected modules with `Viewport` and hooks.
* [Migrating from pdf-lib](https://sdk.pdf.net/docs/v1/migration/from-pdf-lib): move page, form, and text changes from pdf-lib calls to hooks, with the document visible and editable while you change it.
* [Migrating from MuPDF.js](https://sdk.pdf.net/docs/v1/migration/from-mupdf): replace the pixmap render loop, widget calls, and the journal with `Viewport` and hooks.
* [Migrating from PDFium](https://sdk.pdf.net/docs/v1/migration/from-pdfium): move a viewer built on `FPDF_RenderPageBitmap` and the form-fill environment into the browser.
* [Migrating from Aspose.PDF for .NET](https://sdk.pdf.net/docs/v1/migration/from-aspose): move what users see and edit from server-side `Document` code into the browser, and keep the rest on your server.
* [Migrating from iText](https://sdk.pdf.net/docs/v1/migration/from-itext): move form filling, page changes, and stamping that users drive from iText on the server into the browser.
* [Migrating from Ghostscript](https://sdk.pdf.net/docs/v1/migration/from-ghostscript): replace server-rendered page images and thumbnails with `Viewport` and `PageCanvas`.

## API reference [#api-reference]

Every component, hook, and constant exported by `@sdk-pdf/react` has its own page. See the [API reference](https://sdk.pdf.net/docs/v1/reference) for the full list, grouped by area: components, document, viewport, pages, selection, and widgets.

## Installation [#installation]

```sh
npm install @sdk-pdf/react
```

The package is distributed through our private registry; [Getting started](https://sdk.pdf.net/docs/v1/guides/getting-started#installation) explains how to configure npm for the `@sdk-pdf` scope, and [Project setup](https://sdk.pdf.net/docs/v1/guides/getting-started#project-setup) covers the stylesheet, client-only rendering, the `canvas` alias, and React Strict Mode.

React is the first supported framework. Vue, Angular, and Svelte packages are coming soon. [Subscribe to the wishlist](https://forms.gle/m27HpbfwGbExcqrYA) to get notified when yours ships.

