Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To run Adobe PDF Embed API locally, create an Adobe PDF Embed API client ID for the localhost domain, serve your page from a local web server, load Adobe’s hosted viewer script, wait for adobe_dc_view_sdk.ready, initialize AdobeDC.View, and call previewFile with a reachable PDF. The page can be local while the PDF is hosted elsewhere, provided the PDF server permits the browser request.
Adobe’s own getting-started sequence is “Copy it. Run it.” Its general API has no special system requirements, but localhost development still requires a browser, a local HTTP server, registered credentials, and internet access to Adobe’s hosted SDK.
What you need before writing code
- An Adobe account and a PDF Embed API client ID.
- A local web server (Adobe’s tutorial uses Node.js and Express).
- A browser page served over HTTP, for example
http://localhost:3000. - A PDF available at a URL reachable by the browser, or a local file loaded as an
ArrayBuffer. - Internet access to
https://acrobatservices.adobe.com/view-sdk/viewer.js. The viewer JavaScript is hosted by Adobe and cannot be made fully offline.
Adobe’s API is described as free. The client ID is still mandatory: the viewer checks it against the domain serving your page after the first PDF page renders.
1. Create a client ID for localhost
- Open Adobe’s PDF Embed API credential-creation flow and choose PDF Embed API.
- Enter
localhostas the application domain for local testing. - Copy the resulting client ID. Do not substitute an API secret or an unrelated Adobe credential.
- Keep the hostname consistent. A page served from
localhostis different from one served from127.0.0.1or a custom hosts-file name. If you change the hostname, check Adobe’s current credential interface for the accepted domain format and create credentials for that domain when needed.
Adobe says a client ID is mapped to one domain and that the associated domain cannot be edited. Its documented remedy for a wrong domain is to generate new credentials; separate credentials may be needed for subdomains. Because account workflows can change, verify the current portal instructions when replacing a credential.
#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. Serve a page locally
A local file opened with a file:// URL is not the same as a localhost web page. Use a server so the browser has a real HTTP origin and Adobe can validate the registered hostname.
Minimal Node.js/Express server
Create a directory, add an index.html file using the example below, then 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(`Open http://localhost:${port}`);
});
Put the HTML file in a public directory, run npm init -y, install Express with npm install express, and add "start": "node server.js" to the scripts section of package.json. Start it with:
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →npm start
Open http://localhost:3000. Adobe’s local tutorial uses this same port and startup pattern.
3. Add the PDF Embed viewer
This is the smallest URL-based integration following Adobe’s documented pattern:
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.
<!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>
#adobe-dc-view { width: 100%; height: 800px; }
</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 listener matters: it prevents initialization before Adobe’s script has finished loading. The container’s height is a layout requirement for a visible viewer; choose a size appropriate to your page.
Adobe supports full-window, sized-container, inline, and lightbox display approaches. The initialization remains the same; the surrounding container and display configuration determine how the viewer fits your interface.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 114. Choose how the PDF is supplied
Public or CORS-enabled URL
With a URL, Adobe’s viewer fetches the PDF from the browser. The PDF host must allow the request. If the page and PDF are on different origins, configure appropriate CORS response headers on the PDF resource, or host both on the same domain. Inspect the browser’s Network and Console panels for blocked requests, redirects, authentication failures, and incorrect content types.
User-selected or generated PDF with an ArrayBuffer
Adobe’s how-to also accepts a Promise that resolves to an ArrayBuffer. This avoids exposing a public PDF URL and is useful for a file selected by the user:
<input id="pdf-file" type="file" accept="application/pdf">
<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 view = 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 bufferPromise = new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result);
reader.onerror = reject;
reader.readAsArrayBuffer(file);
});
view.previewFile({
content: { promise: bufferPromise },
metaData: { fileName: file.name }
});
});
});
</script>
If both a URL and a file Promise are provided, Adobe says the Promise wins and the URL is ignored. When a URL appears to be ignored, remove the Promise or verify which input path your code is actually populating.
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.
Authenticated documents
For token-protected PDF URLs, Adobe documents passing request headers with the URL. Keep bearer tokens short-lived and avoid placing long-term secrets in client-side source. For cookie-based authentication, initialize AdobeDC.View with downloadWithCredentials: true, and ensure the cookie and CORS policy permit the request.
Credential and loading failures
“Invalid client Id provided”
Check for a typo, accidental whitespace, or a client ID from another Adobe product. Then compare the registered domain with the hostname in the browser address bar. Register localhost for a page opened at http://localhost:3000; changing to an IP address or custom hostname can invalidate the match.
The page loads but the PDF does not
Open DevTools and inspect the PDF request. A CORS rejection, 401/403 response, redirect to a login page, TLS error, or an HTML error document masquerading as a PDF all prevent rendering. Host the file on the same origin or configure the PDF server’s CORS policy for the page’s origin.
The viewer area is blank
Confirm that the container ID exactly matches divId, the container has a non-zero height, the SDK script loaded, and initialization runs only after the ready event. Check for JavaScript exceptions before investigating the document itself.
Localhost works but an IP or staging host fails
That is expected when the credential is registered only for localhost. Create credentials for the actual staging domain according to Adobe’s current portal rules; Adobe states that an existing client ID’s domain mapping cannot be edited.
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.
You need a disconnected installation
That is not supported by the hosted viewer model. Adobe hosts the SDK script, so a fully air-gapped browser cannot load the standard PDF Embed API viewer.
Reliability and security checklist
- Use HTTPS for staging and production, even if localhost uses HTTP.
- Do not commit client IDs or access tokens to public repositories; inject configuration at build or deployment time.
- Restrict PDF CORS responses to the origins that need access rather than using a permissive policy by default.
- Handle expired tokens, missing files, and non-PDF responses visibly in your UI.
- Test both URL and ArrayBuffer paths if users can open remote and local documents.
- Keep the SDK URL external and monitor browser console errors after Adobe updates its hosted script.
Or skip the browser setup
If your actual goal is to produce an image or PDF snapshot of a web page—not embed an interactive Adobe viewer—ScreenshotNeo provides a one-request alternative. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are free, and the response identifies the result with X-Page-Verdict and X-Billed headers. It also offers an MCP server for Claude, Cursor, and other MCP clients, with take_screenshot, get_page_info, and capture_pdf tools.
For a screenshot, see the ScreenshotNeo API documentation and run:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
There is a free allowance of 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots, and every feature is included on every plan. Create a free ScreenshotNeo account to get an API key.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsFAQ
Does the PDF itself have to be hosted on localhost?
No. The page can run on localhost while the PDF comes from a reachable server that allows the browser request.
Can I use 127.0.0.1 instead of localhost?
Only if your Adobe credential is valid for that hostname. Register the exact host you use and confirm Adobe’s current accepted-domain rules.
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.
Can Adobe Embed API run without Node.js?
Yes. Node.js/Express is Adobe’s tutorial example, not a requirement. Any local HTTP server that serves the HTML works.
Which input is better, a URL or an ArrayBuffer?
Use a URL for a document already available to the browser with suitable CORS policy. Use an ArrayBuffer Promise for user-selected or server-fetched content that should not be exposed as a public URL.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Frequently Asked Questions
Does changing the port require a new client ID?
Usually the domain is the important part, but Adobe’s credential interface defines the accepted domain format. Keep the hostname registered and verify current rules if a port change causes validation errors.
Can I host Adobe’s viewer.js locally for offline use?
Adobe’s support guidance says the viewer JavaScript is hosted by Adobe, so fully disconnected operation is not supported.
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.

