Table of Contents

guest
2025-06-12
   Export Notebook
     Configure Puppeteer

Export Notebook


Premium Feature — Available in LabKey Biologics LIMS and the Professional Edition of Sample Manager. Learn more or contact LabKey.

Export Notebook as PDF

To export a notebook as a PDF, you must have correctly configured the Puppeteer service.

Once configured, you will see a button in your notebooks. Click and confirm that Notebook PDF is selected in the popup.

Adjust settings including:

  • Format: Letter or A4.
  • Orientation: Portrait or Landscape.
Click Export to export to PDF.
  • The exported document includes a panels of details about the notebook, including Title, Status, ID, Authors, Creation Date, and Project.
  • Once a notebook has been submitted for review, the exported PDF will include a full review and signing history current as of the time of export.
    • Out for review: Shows who submitted it and when.
    • Returned: Includes who reviewed it and when, as well as the return comments.
    • Approved: The final review status panel will include a full history of submitting, reviewing, and end with who signed the Notebook and when these events occurred.
  • Each notebook entry will begin on a new page, including the first one.
  • The header on every page of the document includes the notebook title, ID, approval status, and author name(s).
  • A footer on every page includes when the document was printed, and once the notebook is approved, this footer repeats the details of when and by whom it was signed and witnessed.

Export Approved/Signed Notebook Archive

Once a notebook has been approved (i.e. signed by reviewers), you'll be able to export the data in an archive format so that you can store it outside the system and refer later to the contents.

If you export both the data and the PDF, as shown above, the exported archive will be named following a pattern like:

[notebook ID].export.zip

It will contain both the PDF (named [notebook ID].pdf) and the notebook's data archive, named following a pattern like:

[notebook ID]_[approval date]_[approval time].notebook-snapshot.zip

The data archive includes structured details about the contents of the notebook, such as:

[notebook ID]_[approval date]_[approval time].notebook-snapshot.zip

├───summary
│ └───[Notebook Title]([Notebook ID]).tsv Notebook properties and values

└───referenced data
├───assay
│ └───[Assay Name]([Assay ID]).tsv Details for referenced assay runs

├───sample
│ ├───[Sample Type1].tsv Details for any referenced samples
│ └───[Sample Type2].tsv of each type included

└───more folders as needed for other referenced items

Note that notebooks approved prior to the 22.6 release will only be exportable in the legacy archive format, using xml files and experiment XAR files.

Related Topics




Configure Puppeteer


Premium Feature — This feature supports Electronic Lab Notebooks, available in LabKey Biologics LIMS and the Professional Edition of Sample Manager. Learn more or contact LabKey.

Puppeteer is an external web service that can be used to generate PDFs from Notebooks created with LabKey ELN. To use this service, you need to obtain the puppeteer premium module, and configure your LabKey Server as described in this topic.

Set Up Puppeteer Service

puppeteer-service is a web service that allows for generation of assets (e.g. PDFs, screenshots) via Puppeteer.

Service Mode:

The puppeteer module has two configuration modes:

  • remote: (Recommended) Remote mode configures LabKey Server to communicate with a remote instance of the puppeteer-service. The service is treated strictly as an external web service where the LabKey Server instance does not manage the service in any way.
  • docker: (Experimental) Docker mode leverages LabKey's docker module to configure and run a puppeteer-service container on the LabKey Server instance. This mode manages the lifecycle of the container (i.e. startup, running, shutdown) which shares computational resources with the LabKey server instance.

Remote Service Mode (Recommended)

Remote mode is recommended for several reasons:

  1. Computational resources. Having the service running alongside LabKey Server, like it does in docker mode, can consume significant CPU and memory resources due to the overhead of the service as well as Docker.
  2. The remote puppeteer-service can be stood up once and shared by several LabKey Server instances (e.g. staging, production, etc.).
For operating in remote mode, all you need to do is obtain the Remote URL and configure the puppeteer module as described below.

Remote URL

The "Remote URL" property specifies the URL where the web service can be found. This is provided by whomever sets up the puppeteer-service instance.

Configure Puppeteer Module

The version of Puppeteer is shown in the lower panel for your reference. Instructions for upgrading are available below.

Startup Properties

All of the puppeteer module properties are also available as LabKey Server Startup Properties. An example properties file (using Docker mode) would look something like:
puppeteer.enabled;startup=true
puppeteer.mode;startup=docker
puppeteer.docker.image;startup=lk-puppeteer-service:latest
puppeteer.docker.port;startup=3031
puppeteer.docker.remapLocalhost;startup=true
puppeteer.remote.url;startup=http://localhost:3031

Docker Service Mode (Experimental)

Deployment

The puppeteer-service can be deployed in a Docker container on either a Linux or OSX host. Docker is required to be installed on the host machine. You can retrieve the latest Docker image from Docker Hub using the following command:

docker pull labkeyteamcity/lk-puppeteer-service

This image can then be run in a container:

docker run -i --init --rm --cap-add=SYS_ADMIN -p 3031:3031 --name puppeteer-service labkeyteamcity/lk-puppeteer-service

To run the container so that it is persistent (i.e. so that it will survive server instance restarts), use the following:

sudo docker run -di --init --cap-add=SYS_ADMIN -p--restart unless-stopped --name puppeteer-service labkeyteamcity/lk-puppeteer-service

A simple HTML view has been added to allow for interacting with the service. To see this view navigate to http://localhost:3031 to get familiar.

Windows Host Deploying this service on a Windows host is not supported nor tested.

Interface

POST to /pdf:
  • inputURL: The URL of the website to create a PDF or screenshot from.
  • apiKey: (Optional) If visiting a LabKey site that requires credentials you can specify an apiKey.
  • fileName: (Optional) Name of the file that is streamed back in the response. Defaults to generated.pdf.
  • printFormat: (Optional) Currently supports Letter and A4 page sizes. Defaults to Letter.
  • printOrientation: (Optional) Supports Portrait and Landscape orientations. Defaults to Portrait.

Configuration Properties

Docker Image Docker mode only. The Docker Image property specifies the name of the puppeteer-service image that is available on the LabKey Server instance. This image has to be downloaded via docker. See service deployment documentation for how to pull down an image.

Docker Port The Docker Port property specifies what host port the service container should be bound to.

Upgrade Puppeteer in Docker Mode

We publish a puppeteer container to hub.docker.com. The method to update to the new container is:

docker pull labkeyteamcity/lk-puppeteer-service
Then restart the docker container.

If puppeteer is running as a service, i.e. persistently, you will follow this process:

  1. Stop the puppeteer container
  2. Remove the container
  3. Pull the latest container image from hub.docker.com
The commands to execute are:
sudo docker stop puppeteer-service
sudo docker rm puppeteer-service
sudo docker pull labkeyteamcity/lk-puppeteer-service:latest

These commands can be run in one set to simplify the steps:

sudo docker stop puppeteer-service && sudo docker rm puppeteer-service && sudo docker pull labkeyteamcity/lk-puppeteer-service:latest

To confirm that you are running the latest container, you can inspect the puppeteer image and compare it to the running container:

sudo docker inspect labkeyteamcity/lk-puppeteer-service:latest | grep Id
and
sudo docker inspect puppeteer-service | grep Image
  • The Image field of the running container "puppeteer-service" should match the ID of the labkeyteamcity/lk-puppeteer-service:latest published container.

Related Topics