scripting

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: 1 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 interface {
	// Execute executes a script in the context of the document.
	Execute(ctx context.Context, script string) (interface{}, error)

	// RegisterDOM registers the PDF Document Object Model with the engine.
	RegisterDOM(dom PDFDOM) error
}

Engine represents a scripting engine (e.g., JavaScript).

type FormFieldProxy

type FormFieldProxy interface {
	GetValue() interface{}
	SetValue(value interface{})
}

FormFieldProxy represents a form field exposed to scripts.

type PDFDOM

type PDFDOM interface {
	// GetField returns a form field by name.
	GetField(name string) (FormFieldProxy, error)

	// GetPage returns a page by index (0-based).
	GetPage(index int) (PageProxy, error)

	// Alert shows an alert dialog (if supported by the viewer/runner).
	Alert(message string)
}

PDFDOM exposes the PDF document structure to the scripting engine. It provides a safe, controlled API for scripts to interact with the PDF.

type PageProxy

type PageProxy interface {
	GetIndex() int
}

PageProxy represents a page exposed to scripts.

Jump to

Keyboard shortcuts

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