types

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Type        ActionType  `json:"type"`                  // Type of action
	Target      string      `json:"target"`                // Target question ID
	Value       interface{} `json:"value,omitempty"`       // Value to set (for set_value)
	Expression  string      `json:"expression,omitempty"`  // Expression to evaluate (for calculate)
	Script      string      `json:"script,omitempty"`      // Custom script to execute
	Description string      `json:"description,omitempty"` // Human-readable description
}

Action represents an action to perform when a condition is met

type ActionType

type ActionType string

ActionType represents the type of action

const (
	ActionTypeShow      ActionType = "show"      // Show field
	ActionTypeHide      ActionType = "hide"      // Hide field
	ActionTypeEnable    ActionType = "enable"    // Enable field
	ActionTypeDisable   ActionType = "disable"   // Disable field
	ActionTypeSetValue  ActionType = "set_value" // Set field value
	ActionTypeCalculate ActionType = "calculate" // Calculate field value
	ActionTypeValidate  ActionType = "validate"  // Trigger validation
	ActionTypeNavigate  ActionType = "navigate"  // Navigate to page/section
	ActionTypeExecute   ActionType = "execute"   // Execute custom script
)

type Annotation added in v0.7.0

type Annotation struct {
	ID         string                 `json:"id"`
	Type       AnnotationType         `json:"type"`
	PageNumber int                    `json:"page_number"`
	Rect       *Rectangle             `json:"rect"`
	Contents   string                 `json:"contents,omitempty"`
	Title      string                 `json:"title,omitempty"`
	Subject    string                 `json:"subject,omitempty"`
	Color      *Color                 `json:"color,omitempty"`
	Border     *Border                `json:"border,omitempty"`
	Actions    []Action               `json:"actions,omitempty"`
	Properties map[string]interface{} `json:"properties,omitempty"`

	// Link-specific
	URI         string `json:"uri,omitempty"`
	Destination string `json:"destination,omitempty"`

	// Text annotation-specific
	Open bool   `json:"open,omitempty"`
	Icon string `json:"icon,omitempty"`

	// Highlight/markup-specific
	QuadPoints []Point `json:"quad_points,omitempty"`
}

Annotation represents a PDF annotation

type AnnotationType added in v0.7.0

type AnnotationType string

AnnotationType represents the type of annotation

const (
	AnnotationTypeLink      AnnotationType = "link"
	AnnotationTypeText      AnnotationType = "text"
	AnnotationTypeHighlight AnnotationType = "highlight"
	AnnotationTypeUnderline AnnotationType = "underline"
	AnnotationTypeStrikeout AnnotationType = "strikeout"
	AnnotationTypeSquiggly  AnnotationType = "squiggly"
	AnnotationTypeCircle    AnnotationType = "circle"
	AnnotationTypeSquare    AnnotationType = "square"
	AnnotationTypeLine      AnnotationType = "line"
	AnnotationTypePolygon   AnnotationType = "polygon"
	AnnotationTypePolyline  AnnotationType = "polyline"
	AnnotationTypeInk       AnnotationType = "ink"
	AnnotationTypeStamp     AnnotationType = "stamp"
	AnnotationTypeCaret     AnnotationType = "caret"
	AnnotationTypeFreeText  AnnotationType = "freetext"
	AnnotationTypePopup     AnnotationType = "popup"
)

type Bookmark added in v0.7.0

type Bookmark struct {
	Title       string     `json:"title"`
	PageNumber  int        `json:"page_number,omitempty"`
	Destination string     `json:"destination,omitempty"`
	URI         string     `json:"uri,omitempty"`
	Color       *Color     `json:"color,omitempty"`
	Style       string     `json:"style,omitempty"` // "bold", "italic", "normal"
	Children    []Bookmark `json:"children,omitempty"`
}

Bookmark represents a bookmark/outline item

type Border added in v0.7.0

type Border struct {
	Width float64   `json:"width"`
	Style string    `json:"style,omitempty"` // "solid", "dashed", "beveled", etc.
	Dash  []float64 `json:"dash,omitempty"`
}

Border represents annotation border properties

type Color added in v0.7.0

type Color struct {
	Space ColorSpace `json:"space"`        // "rgb", "gray", "cmyk", "lab", etc.
	R     float64    `json:"r,omitempty"`  // Red or Gray
	G     float64    `json:"g,omitempty"`  // Green
	B     float64    `json:"b,omitempty"`  // Blue
	C     float64    `json:"c,omitempty"`  // Cyan
	M     float64    `json:"m,omitempty"`  // Magenta
	Y     float64    `json:"y,omitempty"`  // Yellow
	K     float64    `json:"k,omitempty"`  // Black
	L     float64    `json:"l,omitempty"`  // L* (for Lab)
	A     float64    `json:"a,omitempty"`  // a* (for Lab)
	BB    float64    `json:"bb,omitempty"` // b* (for Lab) - using BB to avoid conflict
}

Color represents a color in various color spaces

type ColorSpace added in v0.7.0

type ColorSpace string

ColorSpace represents the color space

const (
	ColorSpaceRGB   ColorSpace = "rgb"
	ColorSpaceGray  ColorSpace = "gray"
	ColorSpaceCMYK  ColorSpace = "cmyk"
	ColorSpaceLab   ColorSpace = "lab"
	ColorSpaceIndex ColorSpace = "indexed"
)

type Condition

type Condition struct {
	Operator   Operator      `json:"operator"`             // Comparison operator
	Value      interface{}   `json:"value,omitempty"`      // Value to compare against
	Values     []interface{} `json:"values,omitempty"`     // Multiple values (for IN operator)
	Expression string        `json:"expression,omitempty"` // Custom expression/script
	Logic      LogicOp       `json:"logic,omitempty"`      // Logic operator for compound conditions
	Children   []Condition   `json:"children,omitempty"`   // Nested conditions
}

Condition represents a condition to evaluate

type ContentDocument added in v0.7.0

type ContentDocument struct {
	Metadata    *DocumentMetadata `json:"metadata,omitempty"`
	Pages       []Page            `json:"pages"`
	Bookmarks   []Bookmark        `json:"bookmarks,omitempty"`
	Annotations []Annotation      `json:"annotations,omitempty"`
	Images      []Image           `json:"images,omitempty"`
	Fonts       []FontInfo        `json:"fonts,omitempty"`
}

ContentDocument represents the complete extracted content from a PDF This is the top-level structure that can be serialized to JSON

type DocumentMetadata added in v0.7.0

type DocumentMetadata struct {
	Title        string                 `json:"title,omitempty"`
	Author       string                 `json:"author,omitempty"`
	Subject      string                 `json:"subject,omitempty"`
	Keywords     string                 `json:"keywords,omitempty"`
	Creator      string                 `json:"creator,omitempty"`
	Producer     string                 `json:"producer,omitempty"`
	CreationDate string                 `json:"creation_date,omitempty"`
	ModDate      string                 `json:"mod_date,omitempty"`
	PDFVersion   string                 `json:"pdf_version,omitempty"`
	PageCount    int                    `json:"page_count"`
	Encrypted    bool                   `json:"encrypted"`
	Custom       map[string]string      `json:"custom,omitempty"`
	XMP          map[string]interface{} `json:"xmp,omitempty"`
}

DocumentMetadata contains document-level metadata

type FontInfo added in v0.7.0

type FontInfo struct {
	ID        string `json:"id"`   // Resource name (e.g., "/F1")
	Name      string `json:"name"` // Font name
	Family    string `json:"family,omitempty"`
	Subtype   string `json:"subtype"`            // "Type1", "TrueType", "Type0", etc.
	Embedded  bool   `json:"embedded"`           // Is font embedded?
	Encoding  string `json:"encoding,omitempty"` // "WinAnsiEncoding", "MacRomanEncoding", etc.
	ToUnicode bool   `json:"to_unicode"`         // Has ToUnicode CMap?
}

FontInfo represents font information

type FormData

type FormData map[string]interface{}

FormData represents the data to fill into the form

type FormField

type FormField struct {
	ID           string                 `json:"id"`
	Name         string                 `json:"name"`
	FullName     string                 `json:"full_name"`
	Type         string                 `json:"type"`
	Value        interface{}            `json:"value,omitempty"`
	DefaultValue interface{}            `json:"default_value,omitempty"`
	Options      []string               `json:"options,omitempty"`
	Required     bool                   `json:"required"`
	ReadOnly     bool                   `json:"read_only"`
	PageNumber   int                    `json:"page_number,omitempty"`
	Properties   map[string]interface{} `json:"properties,omitempty"`
}

FormField represents a field in an XFA form

type FormMetadata

type FormMetadata struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Version     string `json:"version,omitempty"`
	FormType    string `json:"form_type"` // "XFA" or "AcroForm"
	TotalPages  int    `json:"total_pages"`
}

FormMetadata contains information about the form

type FormSchema

type FormSchema struct {
	Metadata  FormMetadata `json:"metadata"`
	Questions []Question   `json:"questions"`
	Rules     []Rule       `json:"rules"` // Control flow rules (dependencies, conditions)
}

FormSchema represents the complete form structure that can be used to rebuild the form with questions, responses, and control flow

type FormStructure

type FormStructure struct {
	Fields   []FormField `json:"fields"`
	Metadata struct {
		TotalFields int    `json:"total_fields"`
		TotalPages  int    `json:"total_pages"`
		FormType    string `json:"form_type,omitempty"`
	} `json:"metadata"`
}

FormStructure represents the complete extracted form structure

type Graphic added in v0.7.0

type Graphic struct {
	Type        GraphicType `json:"type"` // "path", "rectangle", "circle", "line", etc.
	Path        *Path       `json:"path,omitempty"`
	FillColor   *Color      `json:"fill_color,omitempty"`
	StrokeColor *Color      `json:"stroke_color,omitempty"`
	LineWidth   float64     `json:"line_width,omitempty"`
	LineCap     int         `json:"line_cap,omitempty"`  // 0=butt, 1=round, 2=square
	LineJoin    int         `json:"line_join,omitempty"` // 0=miter, 1=round, 2=bevel
	MiterLimit  float64     `json:"miter_limit,omitempty"`
	Transform   [6]float64  `json:"transform,omitempty"` // Transformation matrix
	BoundingBox *Rectangle  `json:"bounding_box,omitempty"`
}

Graphic represents a graphics element (path, shape, etc.)

type GraphicType added in v0.7.0

type GraphicType string

GraphicType represents the type of graphic element

const (
	GraphicTypePath      GraphicType = "path"
	GraphicTypeRectangle GraphicType = "rectangle"
	GraphicTypeCircle    GraphicType = "circle"
	GraphicTypeEllipse   GraphicType = "ellipse"
	GraphicTypeLine      GraphicType = "line"
	GraphicTypePolygon   GraphicType = "polygon"
	GraphicTypePolyline  GraphicType = "polyline"
)

type Image added in v0.7.0

type Image struct {
	ID               string                 `json:"id"`          // Resource name (e.g., "/Im1")
	Width            int                    `json:"width"`       // Width in pixels
	Height           int                    `json:"height"`      // Height in pixels
	Format           string                 `json:"format"`      // "jpeg", "png", "tiff", etc.
	ColorSpace       string                 `json:"color_space"` // "DeviceRGB", "DeviceGray", "DeviceCMYK", etc.
	BitsPerComponent int                    `json:"bits_per_component"`
	Filter           string                 `json:"filter,omitempty"`      // Compression filter (DCTDecode, FlateDecode, etc.)
	Data             []byte                 `json:"data,omitempty"`        // Image data (base64 encoded in JSON)
	DataBase64       string                 `json:"data_base64,omitempty"` // Base64 encoded image data for JSON
	Metadata         map[string]interface{} `json:"metadata,omitempty"`
}

Image represents an embedded image

type ImageRef added in v0.7.0

type ImageRef struct {
	ImageID   string     `json:"image_id"`            // Reference to Image.ID
	X         float64    `json:"x"`                   // X position
	Y         float64    `json:"y"`                   // Y position
	Width     float64    `json:"width"`               // Display width in points
	Height    float64    `json:"height"`              // Display height in points
	Transform [6]float64 `json:"transform,omitempty"` // Transformation matrix
}

ImageRef represents a reference to an image on a page

type LogicOp

type LogicOp string

LogicOp represents logical operators for combining conditions

const (
	LogicOpAnd LogicOp = "and"
	LogicOpOr  LogicOp = "or"
	LogicOpNot LogicOp = "not"
)

type Operator

type Operator string

Operator represents comparison operators

const (
	OperatorEquals         Operator = "equals"           // ==
	OperatorNotEquals      Operator = "not_equals"       // !=
	OperatorGreaterThan    Operator = "greater_than"     // >
	OperatorLessThan       Operator = "less_than"        // <
	OperatorGreaterOrEqual Operator = "greater_or_equal" // >=
	OperatorLessOrEqual    Operator = "less_or_equal"    // <=
	OperatorContains       Operator = "contains"         // String contains
	OperatorNotContains    Operator = "not_contains"     // String does not contain
	OperatorIn             Operator = "in"               // Value in array
	OperatorNotIn          Operator = "not_in"           // Value not in array
	OperatorIsEmpty        Operator = "is_empty"         // Field is empty
	OperatorIsNotEmpty     Operator = "is_not_empty"     // Field is not empty
	OperatorMatches        Operator = "matches"          // Regex match
)

type Option

type Option struct {
	Value       string `json:"value"`                 // Option value
	Label       string `json:"label"`                 // Display label
	Description string `json:"description,omitempty"` // Optional description
	Selected    bool   `json:"selected,omitempty"`    // Is this option selected by default?
}

Option represents a choice option for radio, checkbox, or select types

type PDFEncryption

type PDFEncryption struct {
	Version         int
	Revision        int
	KeyLength       int
	Filter          string
	SubFilter       string
	V               int
	R               int
	O               []byte // Owner password hash (V1-V4) or encrypted owner key (V5+)
	U               []byte // User password hash (V1-V4) or encrypted user key (V5+)
	UE              []byte // Encrypted user encryption key (V5+, AES-256)
	OE              []byte // Encrypted owner encryption key (V5+, AES-256)
	P               int32  // Permissions
	EncryptMetadata bool
	EncryptKey      []byte // Master encryption key
}

PDFEncryption represents PDF encryption parameters

type Page added in v0.7.0

type Page struct {
	PageNumber  int            `json:"page_number"`
	Width       float64        `json:"width"`    // Media box width in points
	Height      float64        `json:"height"`   // Media box height in points
	Rotation    int            `json:"rotation"` // 0, 90, 180, or 270
	MediaBox    *Rectangle     `json:"media_box,omitempty"`
	CropBox     *Rectangle     `json:"crop_box,omitempty"`
	BleedBox    *Rectangle     `json:"bleed_box,omitempty"`
	TrimBox     *Rectangle     `json:"trim_box,omitempty"`
	ArtBox      *Rectangle     `json:"art_box,omitempty"`
	Text        []TextElement  `json:"text,omitempty"`
	Graphics    []Graphic      `json:"graphics,omitempty"`
	Images      []ImageRef     `json:"images,omitempty"`
	Annotations []Annotation   `json:"annotations,omitempty"`
	Resources   *PageResources `json:"resources,omitempty"`
}

Page represents a single page with all its content

type PageResources added in v0.7.0

type PageResources struct {
	Fonts       map[string]FontInfo    `json:"fonts,omitempty"`
	Images      map[string]Image       `json:"images,omitempty"`
	XObjects    map[string]XObject     `json:"xobjects,omitempty"`
	ColorSpaces map[string]string      `json:"color_spaces,omitempty"`
	Patterns    map[string]interface{} `json:"patterns,omitempty"`
	Shadings    map[string]interface{} `json:"shadings,omitempty"`
}

PageResources represents resources used on a page

type Path added in v0.7.0

type Path struct {
	Operations []PathOperation `json:"operations"`
	Closed     bool            `json:"closed"`
}

Path represents a PDF path with operations

type PathOpType added in v0.7.0

type PathOpType string

PathOpType represents the type of path operation

const (
	PathOpMove      PathOpType = "move"
	PathOpLine      PathOpType = "line"
	PathOpCurve     PathOpType = "curve"
	PathOpClose     PathOpType = "close"
	PathOpRectangle PathOpType = "rectangle"
)

type PathOperation added in v0.7.0

type PathOperation struct {
	Type   PathOpType `json:"type"`   // "move", "line", "curve", "close", etc.
	Points []Point    `json:"points"` // Points for this operation
}

PathOperation represents a single path operation

type Point added in v0.7.0

type Point struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

Point represents a 2D point

type Question

type Question struct {
	ID          string                 `json:"id"`                    // Unique identifier
	Name        string                 `json:"name"`                  // Field name from PDF
	Label       string                 `json:"label,omitempty"`       // Display label/question text
	Description string                 `json:"description,omitempty"` // Help text or description
	Type        ResponseType           `json:"type"`                  // Response type
	Options     []Option               `json:"options,omitempty"`     // Options for choice types
	Validation  *ValidationRules       `json:"validation,omitempty"`  // Validation rules
	Default     interface{}            `json:"default,omitempty"`     // Default value
	Required    bool                   `json:"required"`              // Is field required?
	ReadOnly    bool                   `json:"read_only"`             // Is field read-only?
	Hidden      bool                   `json:"hidden"`                // Is field initially hidden?
	Properties  map[string]interface{} `json:"properties,omitempty"`  // Additional properties (position, size, etc.)
	PageNumber  int                    `json:"page_number,omitempty"` // Which page the field appears on
}

Question represents a single question/field in the form

type Rectangle added in v0.7.0

type Rectangle struct {
	LowerX float64 `json:"lower_x"`
	LowerY float64 `json:"lower_y"`
	UpperX float64 `json:"upper_x"`
	UpperY float64 `json:"upper_y"`
}

Rectangle represents a PDF rectangle [llx lly urx ury]

type ResponseType

type ResponseType string

ResponseType represents the type of response expected

const (
	ResponseTypeText      ResponseType = "text"      // Single-line text input
	ResponseTypeTextarea  ResponseType = "textarea"  // Multi-line text input
	ResponseTypeRadio     ResponseType = "radio"     // Radio button group
	ResponseTypeCheckbox  ResponseType = "checkbox"  // Checkbox
	ResponseTypeSelect    ResponseType = "select"    // Dropdown/select
	ResponseTypeNumber    ResponseType = "number"    // Numeric input
	ResponseTypeDate      ResponseType = "date"      // Date picker
	ResponseTypeEmail     ResponseType = "email"     // Email input
	ResponseTypeButton    ResponseType = "button"    // Button (not a question, but action)
	ResponseTypeSignature ResponseType = "signature" // Signature field
	ResponseTypeUnknown   ResponseType = "unknown"   // Unknown type
)

type Rule

type Rule struct {
	ID          string     `json:"id"`                    // Unique rule identifier
	Type        RuleType   `json:"type"`                  // Type of rule
	Source      string     `json:"source"`                // Source question ID
	Condition   *Condition `json:"condition,omitempty"`   // Condition to evaluate
	Actions     []Action   `json:"actions"`               // Actions to perform when condition is met
	Priority    int        `json:"priority,omitempty"`    // Rule priority (for ordering)
	Description string     `json:"description,omitempty"` // Human-readable description
}

Rule represents a control flow rule (dependency/condition)

type RuleType

type RuleType string

RuleType represents the type of control flow rule

const (
	RuleTypeVisibility RuleType = "visibility" // Show/hide fields
	RuleTypeEnable     RuleType = "enable"     // Enable/disable fields
	RuleTypeCalculate  RuleType = "calculate"  // Calculate field value
	RuleTypeValidate   RuleType = "validate"   // Custom validation
	RuleTypeSetValue   RuleType = "set_value"  // Set field value
	RuleTypeNavigate   RuleType = "navigate"   // Navigate to page/section
)

type TextElement added in v0.7.0

type TextElement struct {
	Text        string     `json:"text"`
	X           float64    `json:"x"`                     // X position in points
	Y           float64    `json:"y"`                     // Y position in points
	Width       float64    `json:"width"`                 // Text width in points
	Height      float64    `json:"height"`                // Text height (font size) in points
	FontName    string     `json:"font_name"`             // Font resource name (e.g., "/F1")
	FontSize    float64    `json:"font_size"`             // Font size in points
	FontFamily  string     `json:"font_family,omitempty"` // Extracted font family name
	FontStyle   string     `json:"font_style,omitempty"`  // "normal", "bold", "italic", "bold-italic"
	Color       *Color     `json:"color,omitempty"`
	CharSpacing float64    `json:"char_spacing,omitempty"`
	WordSpacing float64    `json:"word_spacing,omitempty"`
	TextRise    float64    `json:"text_rise,omitempty"`
	TextMatrix  [6]float64 `json:"text_matrix,omitempty"` // Text transformation matrix
	BoundingBox *Rectangle `json:"bounding_box,omitempty"`
}

TextElement represents a piece of text with positioning and styling

type ValidationRules

type ValidationRules struct {
	MinLength    *int     `json:"min_length,omitempty"`
	MaxLength    *int     `json:"max_length,omitempty"`
	MinValue     *float64 `json:"min_value,omitempty"`
	MaxValue     *float64 `json:"max_value,omitempty"`
	Pattern      string   `json:"pattern,omitempty"`       // Regex pattern
	CustomScript string   `json:"custom_script,omitempty"` // Custom validation script
	ErrorMessage string   `json:"error_message,omitempty"` // Error message to display
}

ValidationRules defines validation constraints for a question

type XFACalendar

type XFACalendar struct {
	Symbols  string   `json:"symbols,omitempty"`   // Calendar symbols
	FirstDay string   `json:"first_day,omitempty"` // First day of week
	Weekend  string   `json:"weekend,omitempty"`   // Weekend days
	Holidays []string `json:"holidays,omitempty"`  // Holiday list
}

XFACalendar represents calendar settings

type XFAConfig

type XFAConfig struct {
	Present     *XFAConfigPresent      `json:"present,omitempty"`     // Presentation settings
	Validate    *XFAConfigValidate     `json:"validate,omitempty"`    // Validation settings
	Submit      *XFAConfigSubmit       `json:"submit,omitempty"`      // Submit settings
	Destination *XFAConfigDestination  `json:"destination,omitempty"` // Destination settings
	Acrobat     *XFAConfigAcrobat      `json:"acrobat,omitempty"`     // Acrobat-specific settings
	Common      *XFAConfigCommon       `json:"common,omitempty"`      // Common settings
	Output      *XFAConfigOutput       `json:"output,omitempty"`      // Output settings
	Script      *XFAConfigScript       `json:"script,omitempty"`      // Script settings
	Trace       *XFAConfigTrace        `json:"trace,omitempty"`       // Trace/debug settings
	Properties  map[string]interface{} `json:"properties,omitempty"`  // Additional properties
}

XFAConfig represents configuration settings for the XFA processor

type XFAConfigAcrobat

type XFAConfigAcrobat struct {
	AutoSave     bool   `json:"auto_save,omitempty"`
	AutoSaveTime int    `json:"auto_save_time,omitempty"` // Seconds
	FormType     string `json:"form_type,omitempty"`
	Version      string `json:"version,omitempty"`
}

XFAConfigAcrobat represents Acrobat-specific settings

type XFAConfigCommon

type XFAConfigCommon struct {
	DataPrefix string `json:"data_prefix,omitempty"`
	TimeStamp  string `json:"time_stamp,omitempty"`
}

XFAConfigCommon represents common configuration

type XFAConfigDestination

type XFAConfigDestination struct {
	Type   string `json:"type,omitempty"`   // "email", "file", "printer", etc.
	Target string `json:"target,omitempty"` // Target destination
}

XFAConfigDestination represents destination configuration

type XFAConfigInteractive

type XFAConfigInteractive struct {
	CurrentPage int    `json:"current_page,omitempty"`
	Zoom        string `json:"zoom,omitempty"`
	ViewMode    string `json:"view_mode,omitempty"` // "continuous", "single", etc.
}

XFAConfigInteractive represents interactive form settings

type XFAConfigOutput

type XFAConfigOutput struct {
	Format      string `json:"format,omitempty"`
	Destination string `json:"destination,omitempty"`
}

XFAConfigOutput represents output configuration

type XFAConfigPDF

type XFAConfigPDF struct {
	Version       string `json:"version,omitempty"`       // PDF version
	Compression   string `json:"compression,omitempty"`   // Compression level
	Linearized    bool   `json:"linearized,omitempty"`    // Linearized PDF
	Encryption    string `json:"encryption,omitempty"`    // Encryption method
	EmbedFonts    bool   `json:"embed_fonts,omitempty"`   // Embed fonts
	Tagged        bool   `json:"tagged,omitempty"`        // Tagged PDF
	Accessibility bool   `json:"accessibility,omitempty"` // Accessibility features
}

XFAConfigPDF represents PDF-specific presentation settings

type XFAConfigPresent

type XFAConfigPresent struct {
	PDF                   *XFAConfigPDF         `json:"pdf,omitempty"`
	XDP                   *XFAConfigXDP         `json:"xdp,omitempty"`
	Print                 *XFAConfigPrint       `json:"print,omitempty"`
	Interactive           *XFAConfigInteractive `json:"interactive,omitempty"`
	Script                *XFAConfigScript      `json:"script,omitempty"`
	RenderPolicy          string                `json:"render_policy,omitempty"` // "client" or "server"
	EffectiveOutputPolicy string                `json:"effective_output_policy,omitempty"`
}

XFAConfigPresent represents presentation configuration

type XFAConfigPrint

type XFAConfigPrint struct {
	PrinterName string `json:"printer_name,omitempty"`
	PrinterCap  string `json:"printer_cap,omitempty"`
}

XFAConfigPrint represents print settings

type XFAConfigScript

type XFAConfigScript struct {
	ContentType string `json:"content_type,omitempty"`
	RunAt       string `json:"run_at,omitempty"` // "client", "server", "both"
}

XFAConfigScript represents script configuration

type XFAConfigSubmit

type XFAConfigSubmit struct {
	Format       string            `json:"format,omitempty"`      // "pdf", "xdp", "xml", "html", etc.
	Target       string            `json:"target,omitempty"`      // Target URL
	Method       string            `json:"method,omitempty"`      // "post", "get", "put"
	EmbedPDF     bool              `json:"embed_pdf,omitempty"`   // Embed PDF in submission
	XDPContent   string            `json:"xdp_content,omitempty"` // XDP content type
	TextEncoding string            `json:"text_encoding,omitempty"`
	Properties   map[string]string `json:"properties,omitempty"`
}

XFAConfigSubmit represents submit configuration

type XFAConfigTrace

type XFAConfigTrace struct {
	Enabled bool   `json:"enabled,omitempty"`
	Level   string `json:"level,omitempty"` // "error", "warning", "info", "debug"
}

XFAConfigTrace represents trace/debug configuration

type XFAConfigValidate

type XFAConfigValidate struct {
	ScriptTest string `json:"script_test,omitempty"`
	NullTest   string `json:"null_test,omitempty"`
	FormatTest string `json:"format_test,omitempty"`
}

XFAConfigValidate represents validation configuration

type XFAConfigXDP

type XFAConfigXDP struct {
	Version string `json:"version,omitempty"`
}

XFAConfigXDP represents XDP-specific settings

type XFAConnection

type XFAConnection struct {
	Name            string                 `json:"name"`                       // Connection name
	Type            string                 `json:"type"`                       // Connection type: "http", "soap", "wsdl", "xml", "odbc", etc.
	DataDescription *XFADataDescription    `json:"data_description,omitempty"` // Data description
	Properties      map[string]interface{} `json:"properties,omitempty"`       // Connection properties
}

XFAConnection represents a single data connection

type XFAConnectionHTTP

type XFAConnectionHTTP struct {
	URL        string            `json:"url"`
	Method     string            `json:"method,omitempty"` // "GET", "POST", etc.
	Headers    map[string]string `json:"headers,omitempty"`
	Timeout    int               `json:"timeout,omitempty"` // Timeout in seconds
	Credential *XFACredential    `json:"credential,omitempty"`
}

XFAConnectionHTTP represents HTTP connection details

type XFAConnectionODBC

type XFAConnectionODBC struct {
	DSN        string         `json:"dsn"` // Data source name
	Driver     string         `json:"driver,omitempty"`
	Server     string         `json:"server,omitempty"`
	Database   string         `json:"database,omitempty"`
	Query      string         `json:"query,omitempty"` // SQL query
	Credential *XFACredential `json:"credential,omitempty"`
}

XFAConnectionODBC represents ODBC database connection details

type XFAConnectionSOAP

type XFAConnectionSOAP struct {
	WSDL       string            `json:"wsdl,omitempty"`
	Operation  string            `json:"operation,omitempty"`
	Endpoint   string            `json:"endpoint,omitempty"`
	Action     string            `json:"action,omitempty"`
	Namespace  string            `json:"namespace,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
	Credential *XFACredential    `json:"credential,omitempty"`
}

XFAConnectionSOAP represents SOAP connection details

type XFAConnectionSet

type XFAConnectionSet struct {
	Connections []XFAConnection `json:"connections"`
}

XFAConnectionSet represents data connection configurations

type XFACredential

type XFACredential struct {
	Type     string `json:"type,omitempty"` // "basic", "digest", "ntlm", etc.
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
	Domain   string `json:"domain,omitempty"`
}

XFACredential represents authentication credentials

type XFACurrency

type XFACurrency struct {
	Symbol    string `json:"symbol,omitempty"`    // Currency symbol ($, €, etc.)
	Name      string `json:"name,omitempty"`      // Currency name
	Precision int    `json:"precision,omitempty"` // Decimal precision
}

XFACurrency represents currency settings

type XFADataDescription

type XFADataDescription struct {
	Ref        string                 `json:"ref,omitempty"`       // Reference to data description
	Schema     string                 `json:"schema,omitempty"`    // Schema definition
	Namespace  string                 `json:"namespace,omitempty"` // XML namespace
	Properties map[string]interface{} `json:"properties,omitempty"`
}

XFADataDescription represents data description for connections

type XFADatasets

type XFADatasets struct {
	Fields map[string]interface{} `json:"fields"`           // Field name -> value mapping
	Groups []XFAFieldGroup        `json:"groups,omitempty"` // Hierarchical groups of fields
}

XFADatasets represents the data values in an XFA form This contains the actual form data (user inputs or external data)

type XFADatePattern

type XFADatePattern struct {
	Format string `json:"format,omitempty"` // Date format string
	Symbol string `json:"symbol,omitempty"` // Date symbol set
}

XFADatePattern represents date format pattern

type XFAFieldGroup

type XFAFieldGroup struct {
	Name   string                 `json:"name"`
	Fields map[string]interface{} `json:"fields"`
	Groups []XFAFieldGroup        `json:"groups,omitempty"` // Nested groups
}

XFAFieldGroup represents a group of related fields in XFA datasets

type XFALocale

type XFALocale struct {
	Code          string            `json:"code"`                     // Locale code (e.g., "en_US", "fr_FR")
	Name          string            `json:"name,omitempty"`           // Locale name
	Calendar      *XFACalendar      `json:"calendar,omitempty"`       // Calendar settings
	Currency      *XFACurrency      `json:"currency,omitempty"`       // Currency settings
	DatePattern   *XFADatePattern   `json:"date_pattern,omitempty"`   // Date format
	TimePattern   *XFATimePattern   `json:"time_pattern,omitempty"`   // Time format
	NumberPattern *XFANumberPattern `json:"number_pattern,omitempty"` // Number format
	Text          *XFAText          `json:"text,omitempty"`           // Text settings
}

XFALocale represents a specific locale configuration

type XFALocaleSet

type XFALocaleSet struct {
	Locales []XFALocale `json:"locales"`
	Default string      `json:"default,omitempty"` // Default locale code
}

XFALocaleSet represents localization settings for the form

type XFAMargin

type XFAMargin struct {
	Top    float64 `json:"top,omitempty"`
	Right  float64 `json:"right,omitempty"`
	Bottom float64 `json:"bottom,omitempty"`
	Left   float64 `json:"left,omitempty"`
}

XFAMargin represents margin settings

type XFANumberPattern

type XFANumberPattern struct {
	Format    string `json:"format,omitempty"`    // Number format string
	Symbol    string `json:"symbol,omitempty"`    // Number symbol set
	Grouping  string `json:"grouping,omitempty"`  // Grouping separator
	Decimal   string `json:"decimal,omitempty"`   // Decimal separator
	Precision int    `json:"precision,omitempty"` // Decimal precision
}

XFANumberPattern represents number format pattern

type XFAPadding

type XFAPadding struct {
	Top    float64 `json:"top,omitempty"`
	Right  float64 `json:"right,omitempty"`
	Bottom float64 `json:"bottom,omitempty"`
	Left   float64 `json:"left,omitempty"`
}

XFAPadding represents padding settings

type XFAPosition

type XFAPosition struct {
	X float64 `json:"x,omitempty"`
	Y float64 `json:"y,omitempty"`
}

XFAPosition represents position settings

type XFASize

type XFASize struct {
	Width  float64 `json:"width,omitempty"`
	Height float64 `json:"height,omitempty"`
}

XFASize represents size settings

type XFAStyle

type XFAStyle struct {
	Name       string                 `json:"name"`                 // Style name
	Type       string                 `json:"type,omitempty"`       // Style type: "font", "color", "border", etc.
	Properties map[string]interface{} `json:"properties,omitempty"` // Style properties
}

XFAStyle represents a single style definition

type XFAStyleBorder

type XFAStyleBorder struct {
	Width  float64 `json:"width,omitempty"`
	Style  string  `json:"style,omitempty"` // "solid", "dashed", "dotted", etc.
	Color  string  `json:"color,omitempty"`
	Radius float64 `json:"radius,omitempty"` // Border radius
}

XFAStyleBorder represents border styling

type XFAStyleFont

type XFAStyleFont struct {
	Family     string  `json:"family,omitempty"`     // Font family
	Size       float64 `json:"size,omitempty"`       // Font size
	Weight     string  `json:"weight,omitempty"`     // "normal", "bold", etc.
	Style      string  `json:"style,omitempty"`      // "normal", "italic", etc.
	Color      string  `json:"color,omitempty"`      // Font color
	Decoration string  `json:"decoration,omitempty"` // "none", "underline", etc.
}

XFAStyleFont represents font styling

type XFAStyleLayout

type XFAStyleLayout struct {
	Margin    *XFAMargin   `json:"margin,omitempty"`
	Padding   *XFAPadding  `json:"padding,omitempty"`
	Position  *XFAPosition `json:"position,omitempty"`
	Size      *XFASize     `json:"size,omitempty"`
	Alignment string       `json:"alignment,omitempty"` // "left", "center", "right", etc.
}

XFAStyleLayout represents layout styling

type XFAStylesheet

type XFAStylesheet struct {
	Styles []XFAStyle `json:"styles"`
}

XFAStylesheet represents styling information for the form

type XFAText

type XFAText struct {
	Direction string `json:"direction,omitempty"` // "ltr" or "rtl"
	Encoding  string `json:"encoding,omitempty"`  // Text encoding
}

XFAText represents text settings

type XFATimePattern

type XFATimePattern struct {
	Format string `json:"format,omitempty"` // Time format string
	Symbol string `json:"symbol,omitempty"` // Time symbol set
}

XFATimePattern represents time format pattern

type XObject added in v0.7.0

type XObject struct {
	ID      string     `json:"id"`
	Type    string     `json:"type"` // "Form" or "Image"
	Subtype string     `json:"subtype,omitempty"`
	Width   float64    `json:"width,omitempty"`
	Height  float64    `json:"height,omitempty"`
	Matrix  [6]float64 `json:"matrix,omitempty"`
}

XObject represents an XObject (form or image)

Jump to

Keyboard shortcuts

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