To embed a PDF in React, register an Adobe PDF Embed API client ID for the domain that serves your app, load Adobe’s viewer SDK once, wait for adobe_dc_view_sdk.ready, create an AdobeDC.View instance, and call previewFile with the PDF URL (or a file promise) and metadata. The component below follows that documented JavaScript sequence while handling React’s mount and rerender lifecycle.
What you need before writing React code
- An Adobe PDF Embed API client ID. Adobe’s getting-started guidance says, “You’ll need a client ID to use the Adobe PDF Embed API.”
- The website domains registered for that credential. Include the hostname used in production and the hostname you use for development. Adobe validates the client ID against the website domain when the first page renders.
- A PDF that the browser can request. For a URL-based preview, the URL must be reachable from the user’s browser and permitted by your application’s cross-origin policy.
- A React application that can render a dedicated container element.
Adobe describes the PDF Embed API as free to use; that statement applies to this product and is not a claim that every Adobe document service is free. Review Adobe’s current credential workflow for account and usage terms.
How the integration works
- Render a uniquely identified element such as
pdf-viewer. - Load https://acrobatservices.adobe.com/view-sdk/viewer.js once.
- Wait for the global
adobe_dc_view_sdk.readyevent. - Instantiate
new AdobeDC.View({ clientId, divId }). - Pass a
previewFileobject containing PDF content and metadata, plus a viewer configuration.
Adobe provides React samples, but the documentation does not prescribe a particular hook, package, or cleanup recipe. The component below is therefore a practical React adaptation of the documented, framework-neutral sequence rather than an official Adobe React component.
React component using a PDF URL
Place this component in a client-rendered part of your application. Keep the client ID in environment configuration rather than hard-coding it into multiple components.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minute#1 Best Overall
- 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.
import { useEffect, useRef } from "react";
const SDK_SRC = "https://acrobatservices.adobe.com/view-sdk/viewer.js";
function loadAdobeSdk() {
if (window.AdobeDC) return Promise.resolve();
return new Promise((resolve, reject) => {
const existing = document.querySelector(`script[src="${SDK_SRC}"]`);
const onReady = () => resolve();
document.addEventListener("adobe_dc_view_sdk.ready", onReady, { once: true });
if (existing) {
existing.addEventListener("error", () => reject(new Error("Adobe SDK failed to load")), { once: true });
return;
}
const script = document.createElement("script");
script.src = SDK_SRC;
script.async = true;
script.onerror = () => reject(new Error("Adobe SDK failed to load"));
document.head.appendChild(script);
});
}
export default function PdfEmbed({ clientId, pdfUrl, fileName = "document.pdf" }) {
const viewerId = useRef(`adobe-pdf-${crypto.randomUUID()}`).current;
useEffect(() => {
let cancelled = false;
loadAdobeSdk()
.then(() => {
if (cancelled || !window.AdobeDC) return;
const viewer = new window.AdobeDC.View({
clientId,
divId: viewerId
});
viewer.previewFile(
{
content: { location: { url: pdfUrl } },
metaData: { fileName }
},
{
embedMode: "SIZED_CONTAINER",
defaultViewMode: "FIT_PAGE",
showDownloadPDF: true,
showPrintPDF: true,
showAnnotationTools: true,
enableFormFilling: true
}
);
})
.catch((error) => console.error(error));
return () => {
cancelled = true;
};
}, [clientId, pdfUrl, fileName, viewerId]);
return <div id={viewerId} style={{ width: "100%", height: "800px" }} />;
}
Use it as <PdfEmbed clientId={import.meta.env.VITE_ADOBE_CLIENT_ID} pdfUrl="https://example.com/manual.pdf" /> (adapt the environment-variable syntax to your build tool). The container needs a real height; otherwise a successfully initialized viewer can appear invisible.
Why the lifecycle code matters
- SDK loading: the helper reuses an existing script instead of adding one on every render.
- Ready timing: initialization waits for Adobe’s ready event, not merely for the script element to be inserted.
- Duplicate viewers: changing
pdfUrlcreates a new viewer in the effect. If your UI swaps documents frequently, give each document its own mounted container or add an application-level viewer manager so old instances are not left behind. - Unmounting: the cancellation flag prevents late SDK completion from initializing a component that React has already removed. It does not revoke URLs or cancel your own PDF fetches; handle those separately if you use them.
Supplying PDF bytes instead of a URL
previewFile also accepts a file promise. This is useful when your application fetches protected bytes itself. The precise promise shape should follow the Adobe How Tos documentation for your SDK version. Keep authorization and access control in your server and fetch layer; do not treat viewer UI settings as document security.
A URL must still be downloadable by the browser. A server that requires an Authorization header, blocks the browser’s origin, or returns HTML instead of PDF will fail even when the React code is correct.
Rank #2
- Transform static files into dynamic workspaces with instant answers and insights using PDF Spaces.
- Generate new ideas, summarize information, and get next steps with pre-built or customized assistants.
- Effortlessly create standout content using Adobe Express templates, creative assets, and design tools that bring your content to life.
- Create, organize, edit, and sign your documents with a complete set of PDF tools.
- Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
Choose an embed mode deliberately
| Mode | Best fit | Design implication |
|---|---|---|
| Full Window | The PDF is the primary task on the page. | Uses the available viewer page; Adobe notes annotation tools are unsupported on phones in this mode. |
| Sized Container | A fixed viewer panel inside an application screen. | Reserve explicit width and height for the host element. |
| Inline | PDF content placed within surrounding page content. | Coordinate the viewer’s height with the surrounding layout. |
| Lightbox | Opening a document only after a user action. | Initialize or reveal the viewer from a deliberate interaction rather than on initial page load. |
Configuration can control the default page view, zoom controls, download and print visibility, annotation tools, and form filling. Select only the controls your task requires. Hiding download does not protect the PDF bytes: it is a user-interface setting, not an access-control boundary.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Client IDs, domains, and deployment
- Create the PDF Embed API credential in Adobe’s developer workflow and copy the client ID.
- Register the exact website domains requested by that workflow.
- Use the production hostname, not only
localhost, when testing a deployed build. - Pass the same client ID to
AdobeDC.View. - Test a real first-page render after deployment; domain validation occurs when the first page renders.
Do not expose a secret server credential in the browser. The Embed API client ID is intended for the web integration, while authorization to retrieve sensitive PDFs belongs in your application architecture.
Browser and mobile support
Adobe’s current getting-started page lists current versions of Edge, Chrome, and Firefox on Windows; Safari, Chrome, Edge, and Firefox on macOS; Chrome on Android; and Safari and Chrome on iOS. Browser-version boundaries change, so treat that list as Adobe’s current support statement rather than a permanent compatibility guarantee. Test the actual browsers your users have to use. On phones, annotation tools are unsupported in Full Window mode.
Rank #3
- Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.
- EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
- READ and Comment on PDFs – Intuitive reading modes & document commenting and mark up tools!
- CREATE, COMBINE, SCAN and COMPRESS PDFs.
- FILL forms & Digitally Sign PDFs. Work with Digital certificates
Events, analytics, and consent
Adobe documents callbacks for viewer and file-preview events, including rendering start, first-page rendering completion, rendering failure, and viewer ready. It also documents PDF analytics events such as page views and document downloads. Register listeners with event-selection options so your app subscribes only to events it needs.
sendAutoPDFAnalytics defaults to true. Adobe says setting it to false disables automatic collection in the analytics integrations described in its data documentation. Decide this alongside your consent and privacy design; disabling automatic collection does not prevent you from implementing your own, appropriately governed telemetry.
Troubleshooting
“AdobeDC is undefined” or the viewer never starts
- Confirm the SDK URL is exactly
https://acrobatservices.adobe.com/view-sdk/viewer.js. - Wait for
adobe_dc_view_sdk.ready; inserting the script tag is not the ready signal. - Check Content Security Policy, browser extensions, and network errors.
- Ensure the component runs in the browser, not during server-side rendering.
The first page is blocked or an invalid-client error appears
Verify that the client ID is correct and that the deployed hostname is registered for it. Test the exact origin users visit, including staging versus production.
Rank #4
- 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.
The container is blank
- Give the host element a non-zero height.
- Inspect the PDF request in browser developer tools. Confirm it returns PDF bytes, not an HTML login page.
- Check browser access and your server’s cross-origin policy when using a remote URL.
- Confirm the URL is HTTPS in an HTTPS application.
Controls or annotations are missing
Review the configuration flags and embed mode. Phone limitations apply to annotation tools in Full Window mode. A hidden download button is not a security control.
React renders more than one viewer
Strict Mode and changing props can expose duplicate initialization. Load the script once, use a stable container ID, and ensure an old instance is not retained when a document changes. Keep the cancellation guard and consider mounting one viewer component per active document.
Performance, reliability, and cost considerations
- Load the SDK only on routes that display PDFs, or defer insertion until the viewer is needed.
- Use a stable PDF URL and cache headers appropriate to your document policy.
- Display a loading state until the first-page event and an actionable error state after rendering failure.
- For large or protected documents, prefer a server design that can authorize and stream the file without exposing credentials.
- Measure the events relevant to your product rather than collecting every callback.
Or skip the browser setup
If your goal is generating a clean image or PDF of a web page rather than embedding an interactive PDF viewer, ScreenshotNeo is a separate website screenshot API and MCP server. It removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, with verdict and billing headers returned on each response. AI agents can use its MCP tools such as take_screenshot, get_page_info, and capture_pdf.
Recommended Free Tools
The API accepts many capture options, including full-page lazy-image loading, CSS-selector element capture, device and viewport settings, retina scale, PDF paper and margin controls, custom CSS and JavaScript, click and wait actions, request blocking, headers and cookies, timezone and geolocation, transparency, resizing, caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, and a usage API. These are capture features, not a replacement for Adobe’s in-page PDF viewer.
Best Value
- Create PDF's: Convert any Office file, image, or web page into a high-quality PDF that looks great on any device — desktop, tablet, or smartphone.
- Convert PDF's: Work seamlessly with PDF files, right inside Microsoft 365. You can convert your files with the built-in PDF converter or work with Microsoft 365 files in Acrobat.
- Edit PDF's: Change text and images without leaving your PDF. With Acrobat, it’s easy to edit PDF documents from anywhere, on any mobile device.
- Share PDF's: PDF sharing and reviewing is easy. You can share a link and then review and manage all your feedback online or from your mobile device in one organized place.
- Sign PDF's: Share, track, and manage all your signed documents virtually from anywhere
See the ScreenshotNeo documentation for current parameters. A one-call capture looks like this:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Equivalent Python:
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)
Equivalent Node.js:
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
There are 1,000 free shots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is on every plan. Create a free ScreenshotNeo account.
Frequently Asked Questions
Can I use Adobe PDF Embed API without a React package?
Yes. The documented integration is JavaScript-based: load the viewer SDK, wait for its ready event, create AdobeDC.View, and call previewFile. React can manage that sequence with effects and a host element.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Does hiding the download button prevent users from obtaining the PDF?
No. It changes viewer controls only. Protect the document URL or file-promise endpoint with your application’s authorization design.
Which embed mode should I choose for a dashboard?
Sized Container is usually the natural fit for a panel with a defined width and height. Use Full Window when the PDF is the main page task, Inline for content-flow layouts, and Lightbox for on-demand viewing.
The Bottom Line
A reliable React integration is mostly lifecycle and credential discipline: register every serving domain, load Adobe’s SDK once, initialize only after its ready event, provide browser-reachable PDF content, and choose controls and analytics deliberately.
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.
Free tools Windows power users keep installed
One-click scans. No signup required.

