Skip to Content
NexPDF

Get started

Create a key, install the client for your language and make your first request.

English

Create a key

Sign in and open Cloud API keys in the dashboard. Create a test key to start: it is free, and every PDF it makes carries a small "NexPDF Cloud test key" watermark.

The key is shown once. Keep it on your server and pass it through an environment variable:

export NEXPDF_API_KEY="nxp_test_..."

Every client library reads NEXPDF_API_KEY by itself, so the samples below never contain a key.

Install a client

Pick your language once and every sample on these pages follows it.

Nothing to install: curl ships with macOS, Linux and Windows 10+.

Convert a document

Turn a Word file into a PDF. Any Word, Excel, PowerPoint, image or EPUB file works the same way.

curl https://api.nexpdf.dev/v1/convert/pdf \
  -H "Authorization: Bearer $NEXPDF_API_KEY" \
  -F document=@report.docx \
  -o report.pdf

The answer is the PDF itself. The client prints the units the request cost; with curl, add -i to see the x-nexpdf-units header.

Chain steps

Ask for several things at once with /v1/build. This one OCRs a scan and blacks out every e-mail address it finds:

curl https://api.nexpdf.dev/v1/build \
  -H "Authorization: Bearer $NEXPDF_API_KEY" \
  -F scan=@scan.pdf \
  -F 'instructions={
    "parts": [
      {
        "file": "scan"
      }
    ],
    "actions": [
      {
        "type": "ocr",
        "languages": "eng"
      },
      {
        "type": "redact",
        "query": "email",
        "mode": "pattern"
      }
    ],
    "output": {
      "type": "pdf"
    }
  }' \
  -o searchable.pdf

Go live

When it works, create a live key. Live output has no watermark and draws on your plan's monthly units (the Free plan includes 500). See limits and pricing.

Next

On this page