Skip to content

PDF Generation

Jaydon Reap edited this page May 12, 2023 · 1 revision

Implemented using PDFKit. Documentation found here.

Frontend - public/scheduler/pdfs.js

On-click function makes a call to render the PDF

PDF rendering function makes a POST request to the backend, waits to receive the pdf, and displays in a new window.

The POST request body is the current schedule formatted as a JSON string.

Backend - src/routes/pdf.js

Handles the POST request.

Creates a PDFDocument object, iterates through and writes each day, session, and paper.

Sessions are separated into groups which share the same start and end time.

Within each paper's abstract, formatting of text is converted from HTML to formatted text.

Once a PDF is formatted, it is returned to the frontend for display.

Clone this wiki locally