<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/monokai-sublime.min.css" integrity="sha512-ade8vHOXH67Cm9z/U2vBpckPD1Enhdxl3N05ChXyFx5xikfqggrK4RrEele+VWY/iaZyfk7Bhk6CyZvlh7+5JQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
🌾 ng-oatv0.6.0Angular UI library

PDF Viewer

Embeds a full-featured PDF viewer powered by EmbedPDF. Automatically syncs with the ng-oat theme when syncTheme is enabled.

InputTypeDefaultDescription
srcstring''URL or path to the PDF document
heightstring'600px'CSS height of the viewer container
syncThemebooleantrueAuto-sync with ng-oat's light/dark theme
themeNgOatPdfThemeConfigundefinedManual theme config (ignored when syncTheme is true)
configNgOatPdfViewerConfigundefinedFull EmbedPDF config override
OutputTypeDescription
viewerReadyEmbedPdfContainerEmits the container instance after initialisation

Import & Usage

typescript
import { Component } from '@angular/core';
import { NgOatPdfViewer } from '@letsprogram/ng-oat/pdf-viewer';

@Component({
  selector: 'app-example',
  imports: [NgOatPdfViewer],
  template: `
    <ng-oat-pdf-viewer
      src="https://example.com/doc.pdf"
      height="600px" />
  `,
})
export class ExampleComponent {}

Basic (theme-synced)

Toggle the site theme (top-right) — the PDF viewer follows automatically.

html
<ng-oat-pdf-viewer
  src="https://snippet.embedpdf.com/ebook.pdf"
  height="500px" />

Fixed Dark Theme

html
<ng-oat-pdf-viewer
  src="https://snippet.embedpdf.com/ebook.pdf"
  height="400px"
  [syncTheme]="false"
  [theme]="{ preference: 'dark' }" />

Dynamic Source

html
<ng-oat-pdf-viewer [src]="pdfSrc()" height="400px" />

// In component class:
pdfSrc = signal('https://snippet.embedpdf.com/ebook.pdf');