shredbx logo
shredbx shredbx shredbx shredbx Personal
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
AClaude
  • Home
  • Lab
  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
Andrei Solovev
Packages
Search packages... ⌘K
  • Data & Persistence
    • Databases 3
    • Object Storage 1
    • File Formats 2
    • Enumerations 2
    • Content 1
    • Codegen 2
  • System Integration
    • Secrets 1
    • CLI Tools 5
    • Media Processing 2
    • Adapters 2
  • UI & Components
    • Primitives 1
    • Blocks 1
    • Sections & Layouts 1
    • Entities 1
    • Media 1
    • Utilities 1
    • State & Presenter 1
    • Branding & Style 1
  • Game Engine
    • Framework 1
    • Engine 2
    • Presets 1
    • Vendor 1
Packages/ System Integration/ Media Processing/ Pdf
Go Package

pdf

PDF generation — HTML-to-PDF rendering with template support

Go Ready SI
PDF Generation
$ gen := pdf.NewGenerator()
[pdf] renderer: chromium (headless)
$ gen.FromTemplate(ctx, "invoice", invoiceData)
[pdf] template: invoice
[pdf] rendering HTML — 3 pages
[pdf] page size: A4 (210x297mm)
[pdf] applying print stylesheet
[pdf] generated — 142 KB, 3 pages

About

Generates PDF documents from HTML templates using a headless browser renderer. Supports page size configuration, header/footer templates, and CSS print media rules for professional document output.

Public API

NameKindSignature
Generatortypetype Generator struct
NewGeneratorfuncfunc NewGenerator(opts ...Option) *Generator
FromHTMLfuncfunc (g *Generator) FromHTML(ctx context.Context, html string, opts ...RenderOption) ([]byte, error)
FromTemplatefuncfunc (g *Generator) FromTemplate(ctx context.Context, tmpl string, data any, opts ...RenderOption) ([]byte, error)

Dependencies

Imports (1)

external Go Ready

External process runner — exec.Command wrapper with timeout, output capture, error handling

execprocess-runnertimeoutoutput-capture
5 exports 7 deps

Related Packages

webassets Go Ready

Image processing pipeline — resize, optimize, format conversion via sips/ImageMagick

imagesresizeoptimizationsipsimagemagick
5 exports 2 deps
external Go Ready

External process runner — exec.Command wrapper with timeout, output capture, error handling

execprocess-runnertimeoutoutput-capture
5 exports 7 deps

Source

github.com/shredbx/sbx-core/pkg/pdf
pdfhtml-to-pdftemplatesrendering
shredbx logo shredbx shredbx shredbx shredbx Andrei Solovev

Solution Architect & Lead Software Engineer

ExperiencePortfolioResearch & ExperimentsEducationCertificationSkills
GitHub ↗LinkedIn ↗Email ↗
AVAILABLE FOR NEW PROJECTS
// MY LATEST BEATS
Hobby & Interests

Lab

  • The Lab
  • Framework
  • Components
  • Packages
  • Games
  • Process (SDLC)
  • Knowledge
  • Blog

Andrei

  • Portfolio
  • Experience
  • Services
  • Profile
  • Contact
  • Lifestyle

Team

  • Team
  • Andrei
  • Claude

Legal

  • Privacy
  • Terms
  • Cookies
© 2026 shredbx.com. All rights reserved. — Andrei Solovev |