Files
qr_labels/main.go

39 lines
801 B
Go
Raw Normal View History

2026-04-28 08:26:35 +09:30
package main
import (
2026-04-28 10:52:48 +09:30
"log/slog"
2026-04-28 12:20:14 +09:30
"os"
2026-04-28 08:26:35 +09:30
2026-04-29 11:00:44 +09:30
"code.ppl.town/justin/qr_labels/qr_labels"
2026-04-28 08:26:35 +09:30
)
2026-04-28 12:20:14 +09:30
func main() {
f, _ := os.Create("hello.pdf")
2026-04-29 11:00:44 +09:30
err := qr_labels.GeneratePage(f,
`https://signal.me/#eu/tardisx.81`,
"Wow Nic is cool :-)",
qr_labels.WithQRSize(55),
// qr_labels.WithFont("Helvetica", 16, ""),
// qr_labels.WithBorders(false),
// qr_labels.WithGrid(4, 3),
)
// err := qr_labels.GeneratePage(f, qr_labels.PageOptions{
// // qrURL: "geo:-34.9285,138.6007",
// qrURL: `https://signal.me/#eu/tardisx.81`,
// qrLabel: "Á[Hjqy]|",
// qrSize: 54,
// font: "Helvetica",
// fontStyle: "B",
// fontSize: 34.0,
// rows: 4,
// cols: 3,
// borders: true,
// })
2026-04-28 12:20:14 +09:30
if err != nil {
slog.Error("could not generate pdf", "error", err)
os.Exit(1)
}
2026-04-28 11:59:04 +09:30
2026-04-28 12:20:14 +09:30
}