pdf

package
v0.0.0-...-4d6acc0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDocument

func NewDocument() document.Document

NewDocument creates a new instance of a PDF document processor.

Types

type Document

type Document struct {
	// contains filtered or unexported fields
}

Document implements the document.Document and document.WordProcessor interfaces. It uses composition to delegate logic to specialized smaller units.

func (*Document) AddBookmark

func (p *Document) AddBookmark(name string) error

func (*Document) AddCheckbox

func (p *Document) AddCheckbox(name string, x, y float64) error

func (*Document) AddComboBox

func (p *Document) AddComboBox(name string, x, y, w, h float64, options ...string) error

func (*Document) AddFootnote

func (p *Document) AddFootnote(text string) error

func (*Document) AddHeading

func (p *Document) AddHeading(text string, level int, style ...document.CellStyle) error
func (p *Document) AddHyperlink(text, url string, style ...document.CellStyle) error

func (*Document) AddList

func (p *Document) AddList(items []string, ordered bool, style ...document.CellStyle) error

func (*Document) AddPageBreak

func (p *Document) AddPageBreak() error

func (*Document) AddParagraph

func (p *Document) AddParagraph(text string, style ...document.CellStyle) error

func (*Document) AddRadioButton

func (p *Document) AddRadioButton(name string, x, y float64, options ...string) error

func (*Document) AddRichParagraph

func (p *Document) AddRichParagraph(spans []document.TextSpan) error

func (*Document) AddSection

func (p *Document) AddSection(settings document.PageSettings) error

func (*Document) AddTable

func (p *Document) AddTable(rows, cols int) (document.Table, error)

func (*Document) AddTableOfContents

func (p *Document) AddTableOfContents() error

func (*Document) AddTextField

func (p *Document) AddTextField(name string, x, y, w, h float64) error

func (*Document) AttachFile

func (p *Document) AttachFile(path, name, description string) error

func (*Document) Close

func (p *Document) Close() error

Close releases any resources used by the document.

func (*Document) DrawEllipse

func (p *Document) DrawEllipse(x, y, w, h float64, style ...document.CellStyle) error

func (*Document) DrawLine

func (p *Document) DrawLine(x1, y1, x2, y2 float64, style ...document.CellStyle) error

func (*Document) DrawRect

func (p *Document) DrawRect(x, y, w, h float64, style ...document.CellStyle) error

func (*Document) Export

func (d *Document) Export(uri string) error

func (*Document) GetMetadata

func (p *Document) GetMetadata() (document.Metadata, error)

func (*Document) ImportPage

func (p *Document) ImportPage(path string, pageNum int) error

func (*Document) InsertImage

func (p *Document) InsertImage(path string, width, height float64, style ...document.CellStyle) error

func (*Document) Open

func (p *Document) Open(ctx context.Context, reader io.Reader) error

Open loads a document from a reader.

func (*Document) ReadContent

func (p *Document) ReadContent() (string, error)

ReadContent returns the text contentItems of the document.

func (*Document) RegisterFont

func (p *Document) RegisterFont(name, path string) error

func (*Document) Replace

func (p *Document) Replace(replacements map[string]string) error

Replace replaces keywords with new values.

func (*Document) Save

func (p *Document) Save(ctx context.Context, writer io.Writer) error

Save writes the document to a writer.

func (*Document) Search

func (p *Document) Search(keywords []string) ([]document.SearchResult, error)

Search finds keywords in the document.

func (*Document) SetContext

func (d *Document) SetContext(ctx context.Context)

func (*Document) SetExportFunc

func (d *Document) SetExportFunc(fn func(doc document.Document, uri string) error)

func (*Document) SetFooter

func (p *Document) SetFooter(text string, style ...document.CellStyle) error

func (*Document) SetHeader

func (p *Document) SetHeader(text string, style ...document.CellStyle) error

func (*Document) SetMetadata

func (p *Document) SetMetadata(metadata document.Metadata) error

func (*Document) SetPageSettings

func (p *Document) SetPageSettings(settings document.PageSettings) error

func (*Document) SetPassword

func (d *Document) SetPassword(password string) error

func (*Document) SetWatermark

func (p *Document) SetWatermark(text string, style ...document.CellStyle) error

func (*Document) Table

func (p *Document) Table(index int) (document.Table, error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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