To run Adobe PDF Embed API locally, register localhost when you create an Adobe PDF Embed API client ID, serve your page from a local web server such as http://localhost:3000, load Adobe’s hosted viewer script, wait for adobe_dc_view_sdk.ready, and call previewFile with a reachable PDF. The page can be local even when the PDF is hosted elsewhere, but the browser must be able to fetch that PDF.
What you need before you start
- An Adobe PDF Embed API client ID.
- A local web server. Adobe’s local tutorial uses Node.js, Express, and port 3000.
- A browser with internet access. The viewer JavaScript is loaded from Adobe’s servers, so a fully disconnected installation is not supported.
- A PDF available either at a URL the browser can reach or as an
ArrayBuffersupplied by your page.
Adobe describes the API as having no special system requirements, but “no environment setup steps” does not mean that a file opened directly with a file:// URL is sufficient. You still need to serve the page and register the hostname used by that page.
1. Create credentials for localhost
- Open Adobe’s developer portal and create credentials for the PDF Embed API.
- Enter
localhostas the application domain for local development. - Copy the generated client ID. You will put it in the browser page, not in server-side code.
Adobe checks the client ID against the domain after the first PDF page begins rendering. The hostname in the browser address bar must match the domain registered for that ID. Adobe’s local example uses http://localhost:3000, so register localhost rather than the complete URL with its protocol and path.
If the page is later served from another hostname, create credentials for that hostname. Adobe’s support guidance says a client ID is mapped to one domain and that the mapping cannot be edited; its stated workaround is to generate new credentials. It also recommends separate credentials for subdomains. Because the credential portal can change, confirm the exact accepted domain format there when using a custom local hostname or an unusual port.
#1 Best Overall
- Work securely offline — without connecting to the cloud — with desktop-only PDF tools.
- Edit text and images and reorder and delete pages in a PDF.
- Convert PDFs to Microsoft Word, Excel, or PowerPoint files while preserving fonts, formatting, and layouts.
- Easily create, fill, and sign forms.
- Password-protect documents or redact sections of a PDF to keep sensitive information secure.
2. Create a minimal Node.js server
Make a project directory, initialize it, and install Express:
mkdir adobe-pdf-local
cd adobe-pdf-local
npm init -y
npm install express
Change the scripts section of package.json to include a start command:
{
"scripts": {
"start": "node server.js"
}
}
Create server.js:
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
app.use(express.static(path.join(__dirname, 'public')));
app.listen(port, () => {
console.log(`PDF viewer running at http://localhost:${port}`);
});
Create a public directory. Express will serve everything in that directory, including your HTML page.
Rank #2
- Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
- Edit text and images without jumping to another app.
- E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
- Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
- Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.
3. Load the Adobe viewer in the page
Create public/index.html with a container, Adobe’s hosted SDK, and the initialization sequence documented by Adobe:
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Local PDF viewer</title>
<style>
html, body { margin: 0; height: 100%; }
#adobe-dc-view { height: 100vh; }
</style>
</head>
<body>
<div id="adobe-dc-view"></div>
<script src="https://acrobatservices.adobe.com/view-sdk/viewer.js"></script>
<script>
document.addEventListener("adobe_dc_view_sdk.ready", function () {
const adobeDCView = new AdobeDC.View({
clientId: "YOUR_CLIENT_ID",
divId: "adobe-dc-view"
});
adobeDCView.previewFile({
content: {
location: {
url: "https://example.com/document.pdf"
}
},
metaData: {
fileName: "document.pdf"
}
});
});
</script>
</body>
</html>
Replace YOUR_CLIENT_ID and the example PDF URL. The adobe_dc_view_sdk.ready event matters: it prevents your code from trying to construct AdobeDC.View before the remotely hosted SDK has loaded. The divId must match the container’s ID, and fileName supplies the name shown by the viewer.
4. Start and verify the localhost app
- Run
npm startfrom the project directory. - Open http://localhost:3000 in the browser.
- Open the browser developer console and Network panel if the viewer does not appear.
A correct setup loads the page, downloads Adobe’s viewer script, validates the client ID against localhost, and then requests the PDF. A local page does not make the PDF local: the browser still needs a successful request to the PDF resource.
Rank #3
- Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go.
- Edit text and images without jumping to another app.
- E-sign documents or request e-signatures on any device. Recipients don’t need to log in to e-sign.
- Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
- Share PDFs for collaboration. Commenting features make it easy for reviewers to comment, mark up, and annotate.
Choosing how to supply the PDF
Use a URL
The URL form is the smallest integration:
adobeDCView.previewFile({
content: {
location: { url: "https://files.example.org/reports/report.pdf" }
},
metaData: { fileName: "report.pdf" }
});
If the PDF is on another origin, that origin must permit the browser request with appropriate CORS response headers. The alternative is to host the page and PDF on the same domain. A PDF URL that works when pasted into a tab can still fail inside the viewer if its server rejects cross-origin requests.
Pass a local file as an ArrayBuffer Promise
For a user-selected file, read it in the browser and pass the resulting ArrayBuffer through a Promise. This avoids fetching the file from a separate URL:
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →<input id="pdf-file" type="file" accept="application/pdf">
<div id="adobe-dc-view"></div>
<script>
let adobeDCView;
document.addEventListener("adobe_dc_view_sdk.ready", function () {
adobeDCView = new AdobeDC.View({
clientId: "YOUR_CLIENT_ID",
divId: "adobe-dc-view"
});
document.getElementById("pdf-file").addEventListener("change", function (event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = function () {
adobeDCView.previewFile({
content: { promise: Promise.resolve(reader.result) },
metaData: { fileName: file.name }
});
};
reader.readAsArrayBuffer(file);
});
});
</script>
When both a URL and a file Promise are supplied, Adobe says the Promise wins and the URL is ignored. If a URL appears to be ignored, search your call for an accidentally supplied Promise.
Rank #4
- EXCLUSIVE AMAZON BUNDLE - Securely create, edit, and share PDFs with Adobe Acrobat Pro. Secure your pc and personal information against advanced threats, frauds, and scams with McAfee Total Protection. Introductory offer for new users
- ULTIMATE TOOL FOR CREATIVING – Create and edit PDFs. Collaborate with ease. E-sign documents and collect signatures. Get everything done in one app, wherever you go
- REVISIONS - Edit text and images without jumping to another app.
- ELECTRONIC SIGNATURES - E-sign documents or request e-signatures on any device. Recipients don’t need to log in to esign.
- CONVERT PDFs - Convert your pdf files to editable Microsoft Word, Excel, or PowerPoint documents.
Authenticated PDF requests
Adobe documents sending request headers with a PDF URL for token-based access. Use the header structure supported by the current Embed API documentation and keep access tokens out of publicly committed HTML. A representative call is:
adobeDCView.previewFile({
content: {
location: {
url: "https://files.example.org/private/report.pdf",
headers: [
{ key: "Authorization", value: "Bearer YOUR_TOKEN" }
]
}
},
metaData: { fileName: "report.pdf" }
});
For cookie-based authentication, initialize the viewer with downloadWithCredentials: true so the documented cookie credentials behavior is enabled. Your server must still allow the request and its credentials according to the browser’s cross-origin rules.
Pick a display mode that fits your layout
Adobe documents full-window, sized-container, inline, and lightbox approaches. The API call is the same; the difference is the container and surrounding page behavior.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- Best value – Over 60% off the world's leading pro creativity tools. Students and teachers get 20+ industry-leading apps including Photoshop, Illustrator, Premiere Pro, and Acrobat Pro, plus Adobe Firefly creative AI.
- Tools for every skill level – Whether using quick and easy templates, exploring GenAI features or starting from scratch for total creative freedom, Creative Cloud Pro can adapt to your needs for standout creations.
- Level up any project – Edit professional headshots in Photoshop, produce YouTube content with Premiere Pro, design logos with Illustrator, and more. Creative Cloud Pro equips you with the tools to bring your ideas to life.
- Loads of perks – Your Creative Cloud Pro plan comes with more than great apps. Membership perks include access to tutorials, templates, fonts, creativity community, and more.
- Unlimited access to standard AI image and vector features, and 4,000 monthly generative credits for premium AI video and audio features.
- Full window: give the viewer a viewport-sized container when reading is the main task.
- Sized container: assign an explicit height and width when the PDF occupies one panel of an application.
- Inline: place the viewer between your own headings, controls, or form fields.
- Lightbox: open the viewer only after a user action, while keeping the initial page compact.
Give the container a real height. A viewer inside a parent with zero or automatic height can load successfully but appear blank because there is no visible space to paint into.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Common localhost failures and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
Invalid client Id provided |
The ID is wrong or is being used from a different domain. | Copy the ID again and compare the registered domain with the hostname in the address bar. For this tutorial, use localhost. |
| The credential was created for the wrong domain | Adobe does not provide an edit path for the existing mapping. | Generate new credentials for the intended domain, then replace the client ID in the page. |
| The page loads but the PDF does not | The PDF server rejects the cross-origin request, redirects unexpectedly, or is unreachable. | Inspect the PDF request in Network tools. Host the PDF on the same domain as the page or configure CORS on the PDF response. |
| A URL is ignored | A Promise was also supplied. | Remove the Promise or intentionally use it; Adobe gives the Promise precedence. |
| The viewer area is blank | The container has no usable height, the SDK event was skipped, or a JavaScript error stopped initialization. | Set a height on the container, wait for adobe_dc_view_sdk.ready, and read the first console error. |
| It works from a file but not from localhost | The page is now using a different origin and therefore a different credential or CORS context. | Register localhost, serve the page consistently, and check the PDF response headers. |
| You expected an offline installation | The viewer script is hosted by Adobe. | Keep network access available. Adobe’s hosted SDK cannot be copied into a fully disconnected environment according to its support guidance. |
Reliability and security considerations
- Keep the client ID in the browser page, but treat private PDF tokens as secrets. Prefer a server that authorizes short-lived access rather than embedding long-lived credentials in source code.
- Test the exact hostname users will open.
localhost, a LAN name, an IP address, and a production domain are different credential and origin situations. - Use the Network panel to distinguish a failed Adobe SDK load from a failed PDF request. They have different owners and different fixes.
- For large or frequently opened documents, measure the PDF response time and size separately from viewer startup. The Embed API cannot make an unavailable or slow origin respond faster.
- Do not promise fully offline behavior: even a page served from your machine depends on Adobe’s hosted JavaScript.
Or skip the browser setup
If what you need is a rendered screenshot of a publicly reachable PDF-viewer page rather than an interactive Adobe viewer embedded in your application, ScreenshotNeo can capture that page with one request. It is not a replacement for Adobe’s interactive PDF controls, and a remote service cannot reach a private localhost URL; deploy the page or expose it through an appropriate public test URL first.
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and each response identifies the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.
Use the documented API examples at https://screenshotneo.com/docs/:
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://stripe.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots, and every feature is available on every plan. Create a free ScreenshotNeo account if a clean capture of your deployed viewer page is the outcome you need.
Final checklist
- The PDF Embed API client ID was created for
localhost. - The page is served at a local HTTP URL, not opened only as a file.
- The Adobe viewer script loads before initialization.
- The container ID and its height are correct.
- The PDF URL is reachable and permits CORS, or an ArrayBuffer Promise is supplied.
- Authentication headers or cookie credentials are configured only when required.
- The browser console and Network panel show no client-ID, SDK, CORS, or PDF errors.
Once those checks pass, the localhost setup is complete: Adobe’s browser viewer is initialized with your registered client ID and renders the PDF through previewFile.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

