@cloudpdf/viewer-angular
v3.0.0-next.15
Published
The full viewer as an Angular component with the CloudPDF engine as its default: the same <epdf-pdf-viewer> as @embedpdf/viewer-angular, rendering on CloudPDF SaaS or your own @cloudpdf/server over HTTPS, the local engine loaded only when stamps need it.
Maintainers
Readme
@cloudpdf/viewer-angular
The full EmbedPDF viewer as an Angular component, with the CloudPDF engine as its default. There
is no WebAssembly and no Web Worker in your bundle for reading: rendering
happens on CloudPDF (the SaaS, or your own
@cloudpdf/server), so the
only thing that crosses the network is HTTPS API traffic.
npm install @cloudpdf/viewer-angularimport { Component, input } from '@angular/core';
import { EpdfPdfViewer } from '@cloudpdf/viewer-angular';
@Component({
selector: 'app-report',
imports: [EpdfPdfViewer],
template: `<epdf-pdf-viewer [src]="{ token: token() }" style="height: 100vh" />`,
})
export class Report {
readonly token = input.required<string>();
}src is the document: { token } with a document token your backend creates
for the user (a string, or a function that gives a fresh one), { id } when the
engine's own token already allows it, or { shareToken } with a share link
from the dashboard. Another src opens in its place. For several documents at
once, pass documents: entries of { src, name, password, active }.
The viewer connects to CloudPDF SaaS (https://engine.cloudpdf.com). Your own
@cloudpdf/server goes in the
engine's settings: engine: { baseUrl: 'https://pdf.example.com' }, with the
engine's own token and fetch beside it.
It is the open viewer, with its engine swapped
This package is a door over @embedpdf/viewer-angular,
as that package is the same viewer with the built-in engine: the component is
the same EpdfPdfViewer (<epdf-pdf-viewer>), and so is every name around it. Everything the open viewer
accepts works here unchanged (layout, commands, icons, strings,
theme, plugins, your components inside it, the ready callback) and its
documentation applies verbatim. Only the documents are in the cloud's words.
Documentation
https://www.cloudpdf.com
License
Apache-2.0 — see LICENSE.
Everything CloudPDF ships to a browser is open source; everything that runs on a
server is commercial. This package is browser-side, so it is Apache-2.0 — as is
the viewer it wraps, from the EmbedPDF open-source
project. Rendering happens on a CloudPDF deployment (the SaaS, or a self-hosted
@cloudpdf/server under a
separate written agreement), which is the commercial part.
