Hosted viewer
A link that shows a document in any browser, with nothing to install.
POST /v1/viewer turns a document into a link. Anyone who opens the link sees the document in
their browser, page by page, sharp at any zoom, on a phone or a desktop. There is nothing to install
and your API key is never in the page.
| Field | Meaning |
|---|---|
document | Any file convert accepts, or document_url. |
expires_in | Seconds the link works: 300 (five minutes) to 604800 (seven days). One day by default. |
download | false hides the download button and the PDF; only the page images are served. true by default. |
It answers 201:
{ "id": "vw_1f0e2d8f2c1d9a03b4e57c6a", "url": "https://api.nexpdf.dev/view/4c76…7ceb", "expires_at": 1796652944, "pages": 12 }curl https://api.nexpdf.dev/v1/viewer \
-H "Authorization: Bearer $NEXPDF_API_KEY" \
-F document=@proposal.pdf \
-F expires_in=604800 \
-F download=falseEmbed it
The page may be shown in an <iframe> on your own site:
<iframe src="https://api.nexpdf.dev/view/4c76…7ceb" style="width:100%;height:80vh;border:0" title="Proposal"></iframe>Who can see it
The link holds a 256-bit secret: it cannot be guessed, but anyone who has it can open it until it
expires, so share it only with the people who should see the document. End it early with
DELETE /v1/viewer/{id}, using the id from the answer. Only the key that made a link can end
it. Search engines are asked not to index the page.
The document and its page images are kept only until the link expires or is ended, then deleted.
Cost
1 unit per link, plus the conversion to PDF when the document is not one. Viewing is free, however many times the link is opened.