import { Viewer, DocumentGate } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin, useStage, useStageState } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { localEngine } from '@embedpdf/engine'; import './deep-zoom.css'; const engine = localEngine(); // Open at 250%: past what a whole-page picture shows sharply, so tiles carry it. const plugins = [stagePlugin({ zoom: { level: 2.5 } }), renderPlugin()]; // [!doc-source welcome] const welcome = async (): Promise => { const response = await fetch('https://www.embedpdf.com/pdfs/welcome.pdf'); return { kind: 'bytes', id: 'welcome', bytes: new Uint8Array(await response.arrayBuffer()) }; }; // [!/doc-source] function ZoomBar() { const stage = useStage(); const zoomLevel = useStageState((state) => state.zoomLevel); return (
{Math.round(zoomLevel * 100)}%
); } export default function App() { return ( Loading…

}> {() => }
); }