All Projects → jussiniinikoski → Wasm Pdf

jussiniinikoski / Wasm Pdf

Licence: other
Generate PDF files with JavaScript and WASM (WebAssembly)

Programming Languages

javascript
184084 projects - #8 most used programming language
rust
11053 projects

Projects that are alternatives of or similar to Wasm Pdf

Reportbro Designer
Javascript plugin to visually design report layouts (for pdf and Excel) which can be created with reportbro-lib (a Python package) on the server.
Stars: ✭ 160 (-1.84%)
Mutual labels:  pdf, pdf-generation
Wasm Crypto
A WebAssembly (via AssemblyScript) set of cryptographic primitives for building authentication and key exchange protocols.
Stars: ✭ 146 (-10.43%)
Mutual labels:  webassembly, wasm
Woz
Woz is a progressive WebAssembly app (PWAA) generator for Rust.
Stars: ✭ 145 (-11.04%)
Mutual labels:  webassembly, wasm
Doctron
Docker-powered html convert to pdf(html2pdf), html to image(html2image like jpeg,png),which using chrome(golang) kernel, add watermarks to pdf, convert pdf to images etc.
Stars: ✭ 141 (-13.5%)
Mutual labels:  pdf, pdf-generation
Wasmer Java
☕ WebAssembly runtime for Java
Stars: ✭ 152 (-6.75%)
Mutual labels:  webassembly, wasm
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (-14.11%)
Mutual labels:  webassembly, wasm
Rs Asteroids
A variation on the game Asteroids, written in Rust
Stars: ✭ 146 (-10.43%)
Mutual labels:  webassembly, wasm
Proxy Wasm Rust Sdk
WebAssembly for Proxies (Rust SDK)
Stars: ✭ 137 (-15.95%)
Mutual labels:  webassembly, wasm
Deno Sqlite
Deno SQLite module
Stars: ✭ 151 (-7.36%)
Mutual labels:  webassembly, wasm
Spec
WebAssembly for Proxies (ABI specification)
Stars: ✭ 150 (-7.98%)
Mutual labels:  webassembly, wasm
Proxy Wasm Go Sdk
Go SDK for WebAssembly-based Envoy extensions
Stars: ✭ 137 (-15.95%)
Mutual labels:  webassembly, wasm
Blazor Samples
Explore and learn Syncfusion Blazor components using large collection of demos, example applications and tutorial samples
Stars: ✭ 156 (-4.29%)
Mutual labels:  webassembly, wasm
Nes Rust
NES emulator written in Rust + WASM
Stars: ✭ 141 (-13.5%)
Mutual labels:  webassembly, wasm
Openpdf
OpenPDF is a free Java library for creating and editing PDF files with a LGPL and MPL open source license. OpenPDF is based on a fork of iText. We welcome contributions from other developers. Please feel free to submit pull-requests and bugreports to this GitHub repository. ⛺
Stars: ✭ 2,174 (+1233.74%)
Mutual labels:  pdf, pdf-generation
Svglib
Read SVG files and convert them to other formats.
Stars: ✭ 139 (-14.72%)
Mutual labels:  pdf, pdf-generation
Assemblyscript
A TypeScript-like language for WebAssembly.
Stars: ✭ 13,152 (+7968.71%)
Mutual labels:  webassembly, wasm
Awesome Wasm Tools
😎 A curated list of awesome, language-agnostic WebAssembly tools
Stars: ✭ 139 (-14.72%)
Mutual labels:  webassembly, wasm
Pdfinverter
darken (or lighten) a PDF
Stars: ✭ 139 (-14.72%)
Mutual labels:  pdf, pdf-generation
Libarchivejs
Archive library for browsers
Stars: ✭ 145 (-11.04%)
Mutual labels:  webassembly, wasm
Seed
A Rust framework for creating web apps
Stars: ✭ 3,069 (+1782.82%)
Mutual labels:  webassembly, wasm

WASM-PDF

Generates PDF files directly in the browser with JavaScript and WASM (WebAssembly).

Build Status

Idea here is to push all the work involved in creating a PDF to the browser side, instead of using precious server resources.

Demos

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.

Features

  • PDF contents are described as a JavaScript object and that gets passed to WASM-module, which generates the output
  • Customizable output handler (e.g. load blob URL to a link or directly to window)
  • Currently supported elements include:
    • Paragraphs/text elements with basic fonts (Helvetica, Times, Courier)
    • Images loaded from URL (converted automatically to bytes)
    • Tables with rows and cells
    • Spacers (they just eat space)
    • Paths with points, strokes, fills and alignment
    • Basic styling (all styling parameters are optional)
    • Custom template size (defaults to A4 portrait with 50 px margins)
    • Page numbers and stationary text can be included in template
    • Inline links and bold text (a and b tags) inside paragraph text
  • The generator crate can also be used standalone in a non-browser environment

Example input (JSON)

{
    "title": "Example Document",
    "contents": [{
            "obj_type": "Paragraph",
            "params": {
                "text": "Hello World!",
                "font_size": 18,
                "leading": 24,
                "align": "center",
                "font_name": "Helvetica-Bold"
            }
        }
    ]
}

How to generate an example PDF

Option 1 (with Rust)

  • First install the Rust compiler
  • Clone this repo:git clone https://github.com/jussiniinikoski/wasm-pdf.git
  • Change to directory: cd wasm-pdf
  • Install JavaScript libraries: npm install
  • Launch the local development server: npm run serve
  • Open your browser and visit the url provided by the server, usually http://localhost:8080

Option 2 (with JavaScript only / npm package)

Special Thanks

License

This project is licensed under either of

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].