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 { EpdfAnnotation, EpdfAnnotationDraftMenu, EpdfAnnotationLayer, withAnnotation, } from '@embedpdf/angular/annotation'; import { cloudEngine } from '@cloudpdf/engine'; const layout: OpenInput = { kind: 'grant', grant: 'shr_d2E_LaTuddJbZR00d1CvkqLM' }; const TOOLS = [ { id: 'pointer', label: 'Select' }, { id: 'polygon', label: 'Polygon' }, { id: 'polyline', label: 'Polyline' }, ]; @Component({ selector: 'demo-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: `
`, }) export class Toolbar { protected readonly interaction = inject(EpdfInteraction); protected readonly tools = TOOLS; constructor() { // The polygon tool is active on load: click a few points on the page. this.interaction.activateTool('polygon'); } } // Done and Cancel next to the shape being drawn, for touch screens. @Component({ selector: 'demo-draft-menu', imports: [EpdfAnnotationDraftMenu], changeDetection: ChangeDetectionStrategy.OnPush, template: `Loading…