PDF Export Demo
This demo shows how to export the whole diagram or a part of it to a PDF.
Things to Try
and export the graph as PDF image.
Export Rectangle Contents
to export only the rectangle's region instead of whole graph. Resize and move rectangle
to control the region which will be exported.
Explore the settings for page size, scale, and margin. Note that the scale option only
has an effect if page size is set to
The client-side PDF export also supports custom fonts which is illustrated by the node
labels with custom fonts. To make use of custom fonts, they need to be preprocessed and
registered at the
instance. Please see the
for more details.
- Try to export the image using a Node.js server.
The demo shows an approach that completely runs in the client's browser, as well as an
approach for a server-side export. The client-side export uses
where we contributed major changes and extensions. Please see its readme on
. Although our fork of
adds many features like gradients and line style support, the actual export result may
differ from the graph in the graph component.
The server-side export is a minimal example of how to export the graph using an external
service hosted on a server. It shows the export via a Node.js express server using
The server-side export button will be enabled, when the Node.js is alive on loading time
of the demo. To run the server, see the respective readme in