Generate PDF files with JavaScript and WASM (WebAssembly)
Idea here is to push all the work involved in creating a PDF to the browser side, instead of using precious server resources.
Example that generates a sample PDF document from JSON file. Title in PDF is changed dynamically (in JavaScript) to show current date. Note: this example routes directly to the PDF data blob, so 2 backsteps are needed to return to this page.
Another example that generates 400 paragraphs of Lorem Ipsum and shows a download link when document has been generated (which is instantly 🙂). Also shows page numbers.
This example creates a task calendar.
{ "title": "Example Document", "contents": [{ "obj_type": "Paragraph", "params": { "text": "Hello World!", "font_size": 18, "leading": 24, "align": "center", "font_name": "Helvetica-Bold" } } ] }
git clone https://github.com/jussiniinikoski/wasm-pdf.git
cd wasm-pdf
npm install
npm run serve
http://localhost:8080
This project is licensed under either of