import { ChangeDetectionStrategy, Component, computed, inject, signal, 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 { EpdfShell, withShell } from '@embedpdf/angular/shell'; import type { ShellSnapshot } from '@embedpdf/angular/shell'; import { cloudEngine } from '@cloudpdf/engine'; const welcome: OpenInput = { kind: 'grant', grant: 'shr_gvpJcG1ULUMon19C0D1wODSY' }; // The browser may refuse storage, in a private window: then nothing is remembered. const loadLayout = (): ShellSnapshot | null => { try { return JSON.parse(localStorage.getItem('panels') ?? 'null') as ShellSnapshot | null; } catch { return null; } }; const saveLayout = (snapshot: ShellSnapshot) => { try { localStorage.setItem('panels', JSON.stringify(snapshot)); } catch { // Not remembered this time. } }; const TIPS = [ 'Ctrl or ⌘ and scroll to zoom', 'Pinch to zoom on a touch screen', 'Drag between pages to scroll', ]; @Component({ selector: 'demo-workspace', imports: [EpdfStage, EpdfPageTemplate, EpdfRenderLayer], changeDetection: ChangeDetectionStrategy.OnPush, template: `
Open: {{ open() || 'no panels' }}
Loading…