Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To embed Adobe’s PDF viewer in Angular, register an Adobe PDF Embed API client ID for your site, load Adobe’s viewer.js, render a host element, wait for adobe_dc_view_sdk.ready, then construct AdobeDC.View and call previewFile. In Angular, initialize after the component’s view exists and choose an embed mode that matches your layout.

What you need before you start

  • An Adobe PDF Embed API client ID. Adobe says a client ID is required to use the API. Register the hostnames you will use, including development and production domains as appropriate to Adobe’s credential workflow. Adobe validates the ID against the registered website domain after the first page renders; a mismatch or invalid ID can block the preview. See Adobe’s Getting Started guide.
  • A PDF that the browser can retrieve, or PDF data that your application can provide as an ArrayBuffer.
  • A component with a stable viewer host element. The Adobe SDK is JavaScript-based; Angular’s lifecycle is used here to ensure the host exists before initialization.

Adobe describes PDF Embed API as a way to embed a PDF viewer in a web application with a small amount of code. Adobe’s overview also notes that Angular examples are available, and describes the API as free to use: PDF Embed API overview.

Basic Angular integration

1. Add a host element

Place the viewer target in the component template. Give it a unique ID if more than one PDF viewer can appear on a page. For a sized-container viewer, CSS must provide useful width and height; a zero-height container can make the viewer appear blank.

<div [id]="viewerId" class="pdf-viewer"></div>
.pdf-viewer {
  width: 100%;
  height: 75vh;
  min-height: 480px;
}

2. Load Adobe’s viewer SDK and initialize after the view exists

The following is a practical Angular component pattern based on Adobe’s documented JavaScript setup. It loads the SDK once per page, waits for its ready event, and only then creates a viewer. Set adobePdfEmbedClientId in your environment configuration to the client ID registered for the site. This illustrative code assumes the Angular app is browser-rendered; an app using server-side rendering should guard browser-only globals and initialize only in the browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
  • 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 { AfterViewInit, Component, OnDestroy } from '@angular/core';
import { environment } from '../environments/environment';

declare global {
  interface Window {
    AdobeDC?: any;
    __adobeViewerScriptPromise?: Promise<void>;
  }
}

@Component({
  selector: 'app-pdf-viewer',
  template: '<div [id]="viewerId" class="pdf-viewer"></div>',
  styles: ['.pdf-viewer { width: 100%; height: 75vh; min-height: 480px; }']
})
export class PdfViewerComponent implements AfterViewInit, OnDestroy {
  viewerId = `adobe-dc-view-${Math.random().toString(36).slice(2)}`;
  private readyHandler?: EventListener;
  private destroyed = false;

  private loadAdobeSdk(): Promise<void> {
    if (window.AdobeDC) return Promise.resolve();
    if (window.__adobeViewerScriptPromise) return window.__adobeViewerScriptPromise;

    window.__adobeViewerScriptPromise = new Promise((resolve, reject) => {
      const script = document.createElement('script');
      script.src = 'https://acrobatservices.adobe.com/view-sdk/viewer.js';
      script.async = true;
      script.onload = () => resolve();
      script.onerror = () => reject(new Error('Adobe PDF viewer SDK failed to load'));
      document.head.appendChild(script);
    });
    return window.__adobeViewerScriptPromise;
  }

  async ngAfterViewInit(): Promise<void> {
    try {
      await this.loadAdobeSdk();
      if (this.destroyed) return;

      this.readyHandler = () => {
        if (this.destroyed || !window.AdobeDC) return;
        const adobeDCView = new window.AdobeDC.View({
          clientId: environment.adobePdfEmbedClientId,
          divId: this.viewerId
        });

        adobeDCView.previewFile(
          {
            content: { location: { url: 'https://example.com/sample.pdf' } },
            metaData: { fileName: 'sample.pdf' }
          },
          { embedMode: 'SIZED_CONTAINER' }
        );
      };

      document.addEventListener('adobe_dc_view_sdk.ready', this.readyHandler, { once: true });
      // If the ready event already fired while the script was loading, create the view now.
      if (window.AdobeDC) this.readyHandler(new Event('adobe_dc_view_sdk.ready'));
    } catch (error) {
      console.error('Could not initialize Adobe PDF viewer', error);
    }
  }

  ngOnDestroy(): void {
    this.destroyed = true;
    if (this.readyHandler) {
      document.removeEventListener('adobe_dc_view_sdk.ready', this.readyHandler);
    }
  }
}

Replace the sample PDF URL and filename with your own values. The documented SDK URL, ready event, clientId, divId, content, and metaData shape are described in Adobe’s setup guide and How Tos.

In applications where a component is repeatedly mounted, avoid adding a new script for each instance. The example shares a script-loading promise, generates an instance-specific target ID, and removes its own ready-event listener when destroyed. If multiple viewers are needed simultaneously, create distinct IDs and ensure each viewer initialization targets its own element.

3. Provide PDF content and metadata

Adobe’s previewFile call takes a content object and metadata. For a remotely hosted file, the basic shape is content: { location: { url: pdfUrl } }. Adobe also documents supplying a promise that resolves to an ArrayBuffer when the app obtains PDF bytes itself. Metadata includes a filename, which should accurately identify the displayed document.

Rank #2
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
  • 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
adobeDCView.previewFile(
  {
    content: { location: { url: pdfUrl } },
    metaData: { fileName: 'report.pdf' }
  },
  { embedMode: 'SIZED_CONTAINER' }
);

If the PDF endpoint requires authentication, do not assume a public URL will work for it. Use the documented content approach that fits your app’s access model, and test retrieval from the browser context where the viewer runs. Adobe’s API input guidance is in the How Tos documentation.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the embed mode and viewer behavior

Adobe documents four placement modes. Pick based on the role of the PDF in your interface rather than choosing a mode only because it is the default in an example.

Mode Best fit Implementation consideration
FULL_WINDOW The PDF should occupy the full viewing area. Plan navigation and surrounding app UI so the document has sufficient space.
SIZED_CONTAINER The PDF belongs inside a defined region of an Angular page. Set explicit usable dimensions on the host element.
IN_LINE The PDF should flow as part of the page content. Allow enough page space for the rendered document and test the surrounding layout.
LIGHT_BOX The viewer should open as an overlay above the page. Provide a clear way for users to open and dismiss the viewer in the surrounding UI.

Adobe’s embed modes reference describes these placement choices. For a normal Angular detail page with a viewer panel, SIZED_CONTAINER is a natural starting point.

Rank #3
Adobe Acrobat Reader: Edit PDF
  • VIEW & PRINT ANY PDF
  • USE LIQUID MODE FOR OPTIMAL PDF VIEWING
  • EDIT PDFs
  • MERGE & ORGANIZE PDFs WITH THE PDF CONVERTER
  • SHARE PDFs & COLLABORATE

Preview configuration can also determine the initial view, such as fitting a page or fitting the width, and whether users can zoom. Consider who the viewer serves: a reading interface may prioritize fit-to-width and navigation, while a review flow may need annotation or form interactions. Adobe documents configuration options for viewer behavior, download and print controls, form filling, annotations, and linearization in its How Tos.

Document access, progressive viewing, and controls

URL versus application-provided bytes

A URL location is simplest when the PDF is reachable by the viewer. If your application already fetches document bytes or needs to mediate access, Adobe’s documented content shape also permits a promise resolving to an ArrayBuffer. Match the method to your security and delivery design; do not expose a sensitive document through a public URL merely to simplify the embed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Linearization and loading expectations

Adobe exposes a linearization option for document handling. It is relevant where progressive viewing matters, but it does not remove the need for a reachable PDF and a suitable host layout. Verify behavior with the actual PDFs and delivery path used by your application rather than assuming all files load identically.

Rank #4
Acrobat Pro | 1-Month Subscription | PDF Software |Convert, Edit, E-Sign, Protect |Activation Required [PC/Mac Online Code]
  • 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.

Download, print, and forms

Decide explicitly whether people should download or print the source, and whether they should fill forms in the embedded view. Configure the corresponding viewer options for the intended task. Hiding a control changes the viewer interface; it is not a substitute for access control over the underlying PDF.

Annotations, events, and analytics

Annotation APIs are disabled by default. Adobe distinguishes enabling annotation APIs from including PDF annotations in the document: enabling enableAnnotationAPIs alone does not change the original PDF, while enabling both enableAnnotationAPIs and includePDFAnnotations allows annotation changes to affect the original. Decide whether the app is simply displaying a document or has a deliberate annotation workflow before enabling these behaviors. See Adobe’s annotations documentation.

Viewer event callbacks and analytics can be configured separately. Use events when the application needs to respond to viewer activity, and make analytics collection an intentional product decision rather than assuming it is required for display. Adobe documents event and analytics configuration in its analytics guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
  • EDIT text, images & designs in PDF documents. ORGANIZE PDFs. Convert PDFs to Word, Excel & ePub.
  • READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.
  • CREATE, COMBINE, SCAN and COMPRESS PDFs
  • FILL forms & Digitally Sign PDFs. PROTECT and Encrypt PDFs
  • LIFETIME License for 1 Windows PC or Laptop. 5GB MobiDrive Cloud Storage Included.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Test the Angular integration before release

  • Verify the page’s hostname matches the domain registered for the client ID, first in development and then in production.
  • Confirm the viewer script loads once and that the host element exists before constructing AdobeDC.View.
  • Test the selected embed mode at the actual viewport sizes your layout supports; sized containers need nonzero dimensions.
  • Test with the real PDF delivery method, including authenticated or application-fetched content if applicable.
  • Exercise enabled download, print, form, zoom, and annotation controls as the relevant user role.
  • Check phones separately. Adobe states that annotation tools are not supported on phones in FULL_WINDOW mode; choose and test a suitable alternative experience if phone annotation matters. Consult the current Getting Started guide for browser and device support.

Troubleshooting common failures

Symptom Likely cause What to check
No viewer appears The SDK did not load, initialization ran too early, or the target is missing. Check the network request for viewer.js; initialize after adobe_dc_view_sdk.ready; confirm the exact divId exists in the rendered component.
Preview starts then is blocked The client ID is invalid or is being used on a hostname not registered for it. Confirm the configured client ID and register the actual development or production hostname through Adobe’s credential workflow.
Blank or clipped sized viewer The host has no usable dimensions or its parent layout constrains it. Inspect computed width and height for the viewer and its parents; set a deliberate height for the chosen responsive layout.
PDF does not load The content URL is unavailable to the browser, the file path is wrong, or the supplied content is not in the expected form. Check the PDF request and use the documented URL-location or ArrayBuffer content shape.
Annotation tools are missing Annotation APIs are disabled, the selected mode/device is unsupported for the requested tools, or relevant configuration is absent. Review annotation flags and test the chosen mode on the target device. Full Window mode on phones does not support annotation tools according to Adobe.
Annotations appear but do not update the original Only the annotation APIs are enabled. Review the distinct enableAnnotationAPIs and includePDFAnnotations settings and the intended persistence behavior.

Performance, reliability, and cost considerations

The basic integration is a browser-side SDK load followed by retrieval and rendering of the PDF. Avoid loading duplicate SDK scripts as Angular components mount, provide a host with dimensions appropriate to the selected mode, and test representative files and networks. A URL-based preview depends on the PDF being available to the viewer; an application-managed byte flow adds responsibility for fetching and supplying the data. Adobe describes the API as free to use in its overview, but the app still needs to account for document hosting, delivery, and its own Angular application infrastructure.

For a developer task that is only to create a screenshot or PDF snapshot of a web page rather than embed an interactive PDF viewer, that is a different job from Adobe PDF Embed API. ScreenshotNeo is a website screenshot API and MCP server: it captures a URL as an image or PDF, rather than providing an in-page interactive PDF viewer.

Or skip the browser setup:

If your goal is to capture a page as an image or PDF rather than embed an interactive reader, one GET request can do it. See the ScreenshotNeo API documentation for parameters and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents use screenshot tools. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free screenshots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I use Adobe PDF Embed API with Angular?

Yes. Adobe provides Angular samples alongside its JavaScript-based PDF Embed API documentation.

Does Adobe PDF Embed API require a client ID?

Yes. Adobe requires a client ID, and the site domain must match the domain registered for that ID.

Can I display a PDF fetched by my Angular app instead of a URL?

Adobe documents passing a promise that resolves to an ArrayBuffer as PDF content.

Quick Recap

Bestseller No. 1
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Adobe Acrobat Pro | PDF Software | Convert, Edit, E-Sign, Protect | PC/Mac Online Code | Activation Required
Edit text and images without jumping to another app.; Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
$239.88
Bestseller No. 2
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
PDF Extra Lifetime - Professional PDF Editor - Best Adobe Acrobat Pro Alternative - Lifetime License for Windows PC
Perfect Adobe Acrobat Pro alternative – lifetime license for Windows 10 and 11.; EDIT text, images, pages, hyperlinks, designs in PDF documents. ORGANIZE PDFs.
$99.99
Bestseller No. 3
Adobe Acrobat Reader: Edit PDF
Adobe Acrobat Reader: Edit PDF
VIEW & PRINT ANY PDF; USE LIQUID MODE FOR OPTIMAL PDF VIEWING; EDIT PDFs; MERGE & ORGANIZE PDFs WITH THE PDF CONVERTER
Bestseller No. 4
Acrobat Pro | 1-Month Subscription | PDF Software |Convert, Edit, E-Sign, Protect |Activation Required [PC/Mac Online Code]
Acrobat Pro | 1-Month Subscription | PDF Software |Convert, Edit, E-Sign, Protect |Activation Required [PC/Mac Online Code]
Edit text and images without jumping to another app.; Convert PDFs to editable Microsoft Word, Excel, or PowerPoint documents.
$29.99
Bestseller No. 5
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
PDF Extra 2024| Complete PDF Reader and Editor | Create, Edit, Convert, Combine, Comment, Fill & Sign PDFs | Lifetime License | 1 Windows PC | 1 User [PC Online code]
READ and Comment PDFs – Intuitive reading modes & document commenting and mark up.; CREATE, COMBINE, SCAN and COMPRESS PDFs
$99.99

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.