CloudPDF
DocsPricing
Start building

Full viewer or headless?

Your users see CloudPDF documents through a viewer, and you choose which kind. Both open documents the same way, with a token or a grant, and both check the same permissions. Only what’s on screen differs.

The full viewerHeadless
What you getA finished viewer: toolbar, sidebars, search, comments, forms and signaturesThe parts: pages, text, annotations and forms, with no look of their own
Your workA few lines, then colors, features and buttons of your ownYou build the toolbar, the panels and what happens on each click
Right whenThe viewer is a feature of your appThe viewer is part of your product’s own interface
Works inAny page, React, Vue, Svelte and AngularReact, Vue, Svelte and Angular

You can start with the full viewer and move to headless later: the plugins, their settings and the documents stay the same.

The full viewer#

A few lines on any page, or one component:

import { PDFViewer } from '@cloudpdf/viewer-react';
 
const src = useMemo(
  () => ({ token: tokenFor(contractId) }),
  [contractId],
);
 
<PDFViewer src={src} style={{ height: '100vh' }} />;

tokenFor is the token function from Add PDFs to your app.

People can scroll, zoom, search, comment, fill in forms and sign, as far as their token or grant allows. Make it yours with your brand color, the features you want, and buttons of your own.

Headless#

The viewer’s parts, and your own interface around them:

import { Viewer, DocumentGate } from '@embedpdf/react/runtime';
import { Stage, stagePlugin } from '@embedpdf/react/stage';
import { RenderLayer, renderPlugin } from '@embedpdf/react/render';
import { cloudEngine } from '@cloudpdf/engine';
 
const engine = cloudEngine();
const plugins = [stagePlugin(), renderPlugin()];
 
export function Contract({ contractId }: { contractId: string }) {
  return (
    <Viewer
      engine={engine}
      plugins={plugins}
      initialDocuments={[
        { source: { kind: 'token', token: tokenFor(contractId) } },
      ]}
    >
      <DocumentGate fallback={<p>Opening…</p>}>
        <Stage style={{ height: 600 }}>{() => <RenderLayer />}</Stage>
      </DocumentGate>
    </Viewer>
  );
}

cloudEngine() talks to CloudPDF, and every plugin you add brings one feature: search, annotations, forms. You write the buttons.