Embedding

Quick start

Copy report-designer.js, report-designer.css and the fonts/ folder into your static assets, keeping fonts/ beside the stylesheet, then mount the designer into an element that has a height. The designer fills its root with a toolbar, a palette, the canvas, an inspector and a status bar.

<link rel="stylesheet" href="/assets/report-designer.css">
<div id="designer" style="display: flex; height: 80vh;"></div>
<script src="/assets/report-designer.js"></script>
<script>
  const designer = ErdReportDesigner.mountReportDesigner({
    root: document.getElementById('designer'),
  });
  // Later, when the user saves:
  const templateJson = designer.documentJson();
</script>

Mount options

OptionMeaning
rootRequired. The element whose content is replaced by the designer.
templateThe parsed template object to open. A starter report opens when absent.
prefersDarkStart in dark mode. Afterwards the designer follows data-theme on the html element.
themeColour overrides for the canvas, separate for light and dark.
compositionWhich tools to show, for example report mode or label mode.
pickAssetCalled when the user adds an image asset; returns the file as a data URI.
fontsThe font families your renderer can resolve, offered in the inspector.

What your application keeps

The designer owns the template: reading it, writing it, migrating it and reporting what is wrong with it. Your application owns everything the template touches: who may open it, where it is stored, which fonts and assets exist, what the sample data looks like and how the surrounding page is laid out and themed.

Hiding a tool hides a tool. It does not remove an element kind from the template contract, and a template that already contains one still renders.

Browser support

Evergreen Chromium, Firefox and Safari. The script targets ES2020 and needs Canvas 2D, ResizeObserver and MutationObserver. It defines one global, ErdReportDesigner, and touches nothing else on the page.

Deployment:

Serve the script from your own origin. It has no CORS or cookie requirements. Load it with a version query string and a long cache lifetime, and update the script and the stylesheet together.

Frequently asked questions

Does the designer render PDFs in the browser?

No. The browser script designs and previews templates; the document itself is drawn on your server by one of three ERDesigns products: ERD-Report Cloud as a hosted service with an API key, the ERD-Report Renderer as one binary inside your own process, or the ERD-Report Server as a container in your own infrastructure.

What does the designer cost?

The designer is for embedding in your own website and is not charged for separately.

Rendering is a product of its own: ERD-Report Cloud is the hosted service, with plans and an API key. The ERD-Report Renderer and the ERD-Report Server are licensed per customer, per year, and the renderer has a Free edition for personal use and evaluation.

Do I get the renderer?

Yes. The ERD-Report Renderer is the same engine as one static binary in your own process: a request on stdin, the document on stdout. Its Free edition covers personal use and evaluation with every output format enabled and no watermark; Standard and Enterprise licences cover commercial use. The ERD-Report Server is that same engine as a container in your own infrastructure and is licensed the same way. ERD-Report Cloud stays the hosted option, with plans and an API key.

Can I get a free trial for ERD-Report Cloud?

Yes. Contact ERDesigns to request a trial of ERD-Report Cloud and see what it does for your application. If the data may not leave your own machine, the renderer's Free edition is the way to try the same engine instead.

Do I need a framework or a bundler?

No. The designer is one classic script and one stylesheet with no dependencies. Applications with a bundler or written in TypeScript can use the package build instead.

Can I restyle the designer?

Yes. The chrome is restyled through CSS variables, the canvas through colour tokens for light and dark mode, and the composition option hides the tools you do not want to offer.

Where are templates stored?

In your application. The designer returns the template as JSON and imposes no storage backend.

Which browsers are supported?

Evergreen Chromium, Firefox and Safari.

Can the designer design labels?

Yes. A template carries a target of paper, label or receipt. A label targets ZPL, TSPL, EPL2 or DYMO with the label stock and print head density; a receipt is a kind of its own and targets an ESC/POS receipt printer with the roll width, the print head density and the cut. The same embedding mounts as a label designer or as a receipt designer.

Search all ERD-Report Designer help topics