layout

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {

	// Configuration
	DefaultFont     string
	DefaultFontSize float64
	LineHeight      float64 // Multiplier, e.g., 1.2
	Margins         Margins
	// contains filtered or unexported fields
}

Engine handles the layout and rendering of structured content (Markdown/HTML) into PDF pages.

func NewEngine

func NewEngine(b builder.PDFBuilder) *Engine

NewEngine creates a new layout engine.

func (*Engine) RenderHTML

func (e *Engine) RenderHTML(source string) error

RenderHTML renders an HTML string to the PDF.

func (*Engine) RenderMarkdown

func (e *Engine) RenderMarkdown(source string) error

RenderMarkdown renders a markdown string to the PDF using goldmark.

func (*Engine) SetPageSize

func (e *Engine) SetPageSize(width, height float64)

SetPageSize sets the dimensions for new pages.

type Margins

type Margins struct {
	Top, Bottom, Left, Right float64
}

Margins defines page margins in points.

Jump to

Keyboard shortcuts

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