import { ChangeDetectionStrategy, Component, inject, 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 { EpdfInteraction, withInteraction } from '@embedpdf/angular/interaction'; import { annotationKey, EpdfAnnotation, EpdfAnnotationLayer, withAnnotation, } from '@embedpdf/angular/annotation'; import { cloudEngine } from '@cloudpdf/engine'; const sketch: OpenInput = { kind: 'grant', grant: 'shr_IyOgSdO4AmJqV4BoMv5V0nYU' }; const TOOLS = [ { id: 'pointer', label: 'Select' }, { id: 'square', label: 'Rectangle' }, { id: 'note', label: 'Note' }, ]; @Component({ selector: 'demo-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: `
`, }) export class Toolbar { protected readonly tools = TOOLS; protected readonly interaction = inject(EpdfInteraction); } const time = (date: string | null) => date ? new Date(date).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) : ''; // Who wrote each annotation, and when: the engine fills these in from the identity. @Component({ selector: 'ul[demoAuthors]', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'panel authors' }, template: ` @if (annotations().length === 0) {Loading…