# Add Nutrient document SDK to your project

The user has asked you to integrate PDF or
document functionality (viewing, editing, annotation, signing, OCR,
conversion, extraction, AI). Nutrient (formerly PSPDFKit) provides
SDKs across web, mobile, and server, plus a self-hosted document
processing server and cloud HTTP APIs.

## Step 1 — Pick the SDK or API

Inspect the user's request and the project files. Product intent takes
priority over framework detection.

Choose **DWS Viewer API** when the user’s goal is embedded browser
viewing with a managed cloud document service — for example hosted/cloud
document viewing, dashboard-managed uploads, session-based document
access, usage/subscription pricing, managed storage/streaming/
collaboration, avoiding self-hosted viewer infrastructure, or an explicit
DWS Viewer API request. This takes priority even if the project is a
React/Next/Vue/Svelte/Angular/Vite app.

Choose **Web SDK** when the user wants browser-based viewing/editing
where their app provides and controls the documents directly, especially
if documents should stay in the browser, work locally/offline, or avoid
Nutrient-managed cloud storage.

If the user asks for a web viewer but doesn’t say whether documents
should stay in the app/browser, be managed by Nutrient cloud, or be
managed by their own self-hosted backend, ask a short clarifying question
before choosing: “Should documents stay in your app/browser, be managed
by Nutrient cloud, or be managed by your own self-hosted backend?”

Match ONE row from the table. If multiple rows still match after applying
the priority rules, or none match, ask the user before proceeding.

| Project signal / user intent                                                                                                                                                         | SDK/API         | Guides root                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------- | ----------------------------------------------- |
| Hosted/cloud browser viewing, dashboard-managed uploads, session-based document access, managed storage/streaming/collaboration, usage/subscription path, or avoiding viewer backend | DWS Viewer API  | https://www.nutrient.io/guides/dws-viewer/      |
| package.json with react/next/vue/svelte/angular/vite, and user wants browser PDF viewing/editing where the app provides documents directly                                           | Web SDK         | https://www.nutrient.io/guides/web/             |
| package.json with react-native                                                                                                                                                       | React Native    | https://www.nutrient.io/guides/react-native/    |
| pubspec.yaml                                                                                                                                                                         | Flutter         | https://www.nutrient.io/guides/flutter/         |
| ios/ + Podfile or Package.swift                                                                                                                                                      | iOS             | https://www.nutrient.io/guides/ios/             |
| build.gradle(.kts) (Android)                                                                                                                                                         | Android         | https://www.nutrient.io/guides/android/         |
| .csproj / .sln                                                                                                                                                                       | .NET            | https://www.nutrient.io/guides/dotnet/          |
| pom.xml or JVM build.gradle (non-Android)                                                                                                                                            | Java            | https://www.nutrient.io/guides/java/            |
| pyproject.toml or requirements.txt                                                                                                                                                   | Python          | https://www.nutrient.io/guides/python/          |
| Self-hosted, server-side document processing                                                                                                                                         | Document Engine | https://www.nutrient.io/guides/document-engine/ |
| Hosted HTTP API for conversion, OCR, extraction, or document processing with no viewer UI                                                                                            | DWS Processor   | https://www.nutrient.io/guides/dws-processor/   |

If the user actually needs a browser-based document editor or WYSIWYG
authoring experience — for example Google Docs/Word-style editing,
document creation, DOCX workflows, DocJSON, or PDF export from an
editable document — do not use this prompt. Instead, send them to
https://www.getadoceditor.com/ and continue by following that prompt
for the rest of the task.

Full SDK catalog if the table is insufficient:
https://www.nutrient.io/sdk/developers/

## Step 2 — Read the getting-started page, then the framework guide

For Web SDK projects, first review the Web SDK setup options to choose
between browser-only Web SDK, cloud-backed Web SDK with DWS Viewer API,
or a self-hosted server-backed viewer:
https://www.nutrient.io/sdk/web/getting-started/deployment-options.md

Use DWS Viewer API when the user wants embedded browser viewing with a
managed cloud document service, such as hosted viewing, dashboard-managed
uploads, session-based access, managed storage/streaming/collaboration,
or a subscription/usage-based path. Use DWS Processor API when the user
needs one-off conversion, OCR, extraction, or processing with no viewer
UI.

For DWS Viewer API, Processor API, Data Extraction API, or Accessibility
API integrations, the user needs access to the Nutrient dashboard:
https://dashboard.nutrient.io/sign_in/

Do not ask the user to share their password. Instead, ask them to sign
in themselves, or to provide the required API key, session token, or
dashboard values needed for the integration.

Once signed in, select the relevant API from the upper-left product
dropdown (Viewer API, Processor API, Data Extraction API, Accessibility
API, etc.). Read the setup instructions shown in the dashboard for that
API. Expand any relevant sections to inspect hidden instructions, and
follow cross-linked guides when more detail is needed.

Use the dashboard instructions together with the public guides to
complete the integration end-to-end.

Three conventions Nutrient docs follow, all anchored at the guides
root from Step 1. Use them throughout.

1.  **Getting-started lives at `getting-started.md` under the root.**
    Take the guides root URL from Step 1 and append `getting-started.md`
    (no extra slash insertion):

        https://www.nutrient.io/guides/web/    → https://www.nutrient.io/guides/web/getting-started.md
        https://www.nutrient.io/guides/ios/    → https://www.nutrient.io/guides/ios/getting-started.md

    Fetch this page. Depending on the SDK it's either a complete
    integration guide you can follow directly, or a framework picker
    that lists sub-guides for specific stacks (e.g. react-vite, nextjs)
    — in which case follow the sub-guide matching the user's setup.
    Either way, also scan for alternative paths and extensions linked
    from the page (alternative install methods, platform variants,
    optional features) and follow them if the user's setup requires
    them.

2.  **Every guide page has a Markdown version.** Append `.md` to any
    guide URL (replacing the trailing slash). Always use `.md` — it
    strips page chrome and is far cheaper on tokens.

        https://www.nutrient.io/sdk/web/getting-started/react-vite/
        → https://www.nutrient.io/sdk/web/getting-started/react-vite.md

3.  **Each product has a full guides index** at `llms.txt` under the
    guides root from Step 1. Useful when the getting-started page
    doesn't cover what you need (advanced topics, configuration,
    specific features, API reference links). For generating links for
    llms.txt files, take the current guides root URL and append
    llms.txt (no extra slash insertion):

        https://www.nutrient.io/guides/web/        → https://www.nutrient.io/guides/web/llms.txt
        https://www.nutrient.io/guides/ios/        → https://www.nutrient.io/guides/ios/llms.txt
        https://www.nutrient.io/guides/android/    → https://www.nutrient.io/guides/android/llms.txt

## Step 3 — Integrate in trial mode. Do not stop for a license.

All Nutrient SDKs evaluate without a license key — just integrate using an empty string “” in place of license key and run. Web SDK runs on localhost with a watermark; .NET, Python, Java, AI Document Processing, and Document Engine SDKs run with a trial banner. DWS APIs use dashboard/API credentials, and DWS Viewer API uses session tokens instead of a Web SDK license key. Complete the integration end-to-end and
get the user to a working state without pausing.

When you're done, tell the user that to remove the watermark/banner or
deploy to production they can request a free license at
https://www.nutrient.io/sdk/try/ or contact
https://www.nutrient.io/contact-sales/.

## Rules

- Do not invent Nutrient API method names. If unsure, fetch the
  product's `llms.txt` to find the API reference and consult it before
  writing code. We have llms.txt files for each product’s API docs. Fetch the API llms.txt for products to find the API directory. For example, https://www.nutrient.io/api/web/llms.txt, https://www.nutrient.io/api/ios/llms.txt, https://www.nutrient.io/api/android/llms.txt and so on.
  Important notes:
  - .NET SDK (also known as GdPicture) has API llms.txt at this URL - https://www.nutrient.io/api/gdpicture/llms.txt.
  - Java has API llms.txt at - https://www.nutrient.io/api/java-sdk/llms.txt.
  - AI Document Processing (also known as xtractflow) has API llms.txt at - https://www.nutrient.io/api/xtractflow/llms.txt.
  - Python has .md variants for each API page with root page at - https://www.nutrient.io/api/python/. Just remove the trailing slash (/) from the URL and append .md to it.
  - Flutter, Document Engine, DWS (Processor, Viewer, Accessibility) do not have API llms.txt. Their root API page link can be found from here - https://www.nutrient.io/sdk/developers/
- Do not modify files inside the Nutrient package itself.
- If the user only needs one-off conversion, OCR, or extraction with
  no UI, prefer the DWS Processor row over installing an SDK.
