web

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 5 Imported by: 0

README

TinyPDF Web Demo

Web application that generates PDFs in the browser using WebAssembly.

Prerequisites

Build

Compile the WASM client:

tinygo build -o public/client.wasm -target wasm -no-debug ./client.go

The -no-debug flag strips debug info to reduce binary size.

Run

Start the static file server:

go run server.go

Open http://localhost:4430 in your browser.

Options
go run server.go -port 8080 -public-dir ./public

Environment variables PORT and PUBLIC_DIR are also supported.

Project structure

web/
  client.go      WASM entry point (build tag: wasm)
  server.go      Static file server (build tag: !wasm)
  public/
    index.html   HTML shell
    script.js    Go WASM bootstrap (instantiates client.wasm)
    style.css    Styles
    client.wasm  Compiled WASM binary (generated)
  ui/
    ui.go        DOM setup and event handlers
    pdf.go       PDF generation logic

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL