import { Viewer, DocumentGate } from '@embedpdf/react/runtime'; import type { OpenInput } from '@embedpdf/react/runtime'; import { Stage, stagePlugin } from '@embedpdf/react/stage'; import { RenderLayer, renderPlugin } from '@embedpdf/react/render'; import { interactionPlugin } from '@embedpdf/react/interaction'; import { FormLayer, formPlugin, useForm, useFormSettings } from '@embedpdf/react/form'; import { localEngine } from '@embedpdf/engine'; import './colors.css'; const engine = localEngine(); // The colors the viewer draws around fields; `null` follows the viewer's accent. const plugins = [ stagePlugin(), renderPlugin(), interactionPlugin(), formPlugin({ fields: { border: '#ea580c' } }), ]; const forms = async (): Promise => { const response = await fetch('https://www.embedpdf.com/pdfs/forms.pdf'); return { kind: 'bytes', id: 'forms', bytes: new Uint8Array(await response.arrayBuffer()) }; }; const COLORS = [ ['Accent', null], ['Orange', '#ea580c'], ['Green', '#16a34a'], ] as const; function ColorToolbar() { const form = useForm(); const settings = useFormSettings(); return (
Edges
{COLORS.map(([label, color]) => ( ))}
Focus
{COLORS.map(([label, color]) => ( ))}
); } export default function App() { return ( Loading…

}> {() => ( <> )}
); }