import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; import { EpdfDocumentGate, provideEmbedPdf } from '@embedpdf/angular/runtime'; import type { OpenInput } from '@embedpdf/angular/runtime'; import { EpdfPageTemplate, EpdfStage, withStage } from '@embedpdf/angular/stage'; import { EpdfRenderLayer, withRender } from '@embedpdf/angular/render'; import { withInteraction } from '@embedpdf/angular/interaction'; import { withActions, withActionsUi } from '@embedpdf/angular/actions'; import { EpdfLinkLayer, withLink } from '@embedpdf/angular/link'; import { localEngine } from '@embedpdf/engine'; const links = async (): Promise => { const response = await fetch('https://www.embedpdf.com/pdfs/links.pdf'); return { kind: 'bytes', id: 'links', bytes: new Uint8Array(await response.arrayBuffer()) }; }; @Component({ selector: 'demo-root', imports: [EpdfDocumentGate, EpdfStage, EpdfPageTemplate, EpdfRenderLayer, EpdfLinkLayer], providers: [ provideEmbedPdf( { engine: () => localEngine(), initialDocuments: [{ source: links }] }, withStage(), withRender(), withInteraction(), // The actions plugin runs a link that names a viewer command, such as the footer's Next. withActions(), // The browser's way to open a website, once for the viewer. withActionsUi(), withLink(), ), ], changeDetection: ChangeDetectionStrategy.OnPush, styleUrl: './basic.css', encapsulation: ViewEncapsulation.None, template: `

Every blue label is a link. Click one, or press Tab to reach it and Enter to follow it.

Loading…

`, }) export class App {}