> ## Documentation Index
> Fetch the complete documentation index at: https://docs.doconda.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I fill in, sign and annotate a PDF in a React app?

> Render DocondaEditor with a .pdf: your users fill in forms, sign with a certificate, highlight, comment and organize pages in the browser, with no server.

Use Doconda's editor plugin, `@doconda/editor`, and pass the `.pdf` in `src`. Your users fill in form fields, sign,
add text, highlight, comment, and rotate, reorder, delete or add pages. Everything runs in their browser: the file isn't
uploaded anywhere to be edited.

## Add a PDF editor

1. Get the plugin in the dashboard, under **Editor**, with a 7-day free trial. See
   [licence and domains](https://docs.doconda.com/editor/license.md).
2. Install it with the command the dashboard gives you (it needs React 19 or later):

```bash theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
# .npmrc with the registry and token from the dashboard (Editor)
npm install @doconda/editor
```

3. Put the editor in a container with a height and pass the `.pdf` link:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
import { DocondaEditor } from "@doconda/editor"

export function SignPdf({ url }: { url: string }) {
  return (
    <div style={{ height: 760, display: "flex" }}>
      <DocondaEditor src={url} licenseKey="ek_eu_…" author="Ana García" className="flex-1" />
    </div>
  )
}
```

4. Get the PDF when the user saves, with `onSave` or with the ref's `save()`. Both give the PDF's bytes:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
const editor = useRef<EditorHandle>(null)
const bytes = await editor.current!.save() // Uint8Array with the edited .pdf
```

`author` signs the comments the user leaves. On `localhost` the editor opens without a licence key, with a development
notice.

## What users can do in a PDF

* **Forms**: fill in text fields, checkboxes, radio buttons and dropdowns. They stay PDF fields when saved.
* **Sign**: a digital signature with a certificate (`.p12`/`.pfx`, or PEM/DER with its key), optionally with a picture of
  the signature. The editor also verifies the signatures the file already has.
* **Annotate**: highlight, underline, strike out, notes, free text, shapes, freehand drawing and stamps. They are standard
  PDF annotations, so Acrobat or Preview shows them and can move or delete them.
* **Edit the PDF's own text**, add pictures and watermarks, and **redact**: redacted content is removed from the file,
  not only covered.
* **Pages**: insert blank pages, duplicate, rotate, move, crop and delete.
* **Print**.

## Choose the buttons

```tsx theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
<DocondaEditor src={url} toolbar="undo redo | highlight draw | note | sign" />
```

To remove the page tools, leave `addPage`, `rotatePage`, `deletePage` and `pageTools` out of `toolbar`; for forms,
leave out `forms`.

## FAQ

> [accordion] Is the PDF uploaded to Doconda?
>
> No. The editor opens, edits and saves it in the browser. Only the licence check reaches Doconda's API.

> [accordion] Can I convert the PDF to Word?
>
> Yes, from the editor's **File** menu. With the API, `POST /v1/convert` with `to: "docx"` does it on your server; see
> [Convert files](https://docs.doconda.com/guides/convert.md).

> [accordion] Can several people annotate the same PDF at once?
>
> Yes, with the `collab` prop: in a PDF, the annotations are shared live. See
> [real-time co-editing](https://docs.doconda.com/editor/collaboration.md).

For every toolbar item and prop, see [customize](https://docs.doconda.com/editor/customize.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.