Documentation
¶
Overview ¶
Package forms provides a unified interface for working with PDF forms It supports both AcroForm and XFA form types with automatic detection
Index ¶
- func ExtractAcroForm(pdfBytes []byte, password []byte, verbose bool) (*acroform.AcroForm, error)
- func ExtractXFA(pdfBytes []byte, password []byte, verbose bool) (*types.FormSchema, *types.XFADatasets, error)
- type AcroFormWrapper
- func (w *AcroFormWrapper) Fill(pdfBytes []byte, data types.FormData, password []byte, verbose bool) ([]byte, error)
- func (w *AcroFormWrapper) GetValues() map[string]interface{}
- func (w *AcroFormWrapper) Schema() *types.FormSchema
- func (w *AcroFormWrapper) Type() FormType
- func (w *AcroFormWrapper) Validate(data types.FormData) []error
- type Form
- type FormType
- type XFAFormWrapper
- func (w *XFAFormWrapper) Fill(pdfBytes []byte, data types.FormData, password []byte, verbose bool) ([]byte, error)
- func (w *XFAFormWrapper) GetValues() map[string]interface{}
- func (w *XFAFormWrapper) Schema() *types.FormSchema
- func (w *XFAFormWrapper) Type() FormType
- func (w *XFAFormWrapper) Validate(data types.FormData) []error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAcroForm ¶
ExtractAcroForm extracts an AcroForm (type-specific)
func ExtractXFA ¶
func ExtractXFA(pdfBytes []byte, password []byte, verbose bool) (*types.FormSchema, *types.XFADatasets, error)
ExtractXFA extracts XFA form data (type-specific) Returns the FormSchema and Datasets separately
Types ¶
type AcroFormWrapper ¶
type AcroFormWrapper struct {
// contains filtered or unexported fields
}
AcroFormWrapper wraps an AcroForm to implement the Form interface
func (*AcroFormWrapper) GetValues ¶
func (w *AcroFormWrapper) GetValues() map[string]interface{}
func (*AcroFormWrapper) Schema ¶
func (w *AcroFormWrapper) Schema() *types.FormSchema
func (*AcroFormWrapper) Type ¶
func (w *AcroFormWrapper) Type() FormType
type Form ¶
type Form interface {
// Type returns the form type (AcroForm or XFA)
Type() FormType
// Schema returns the form schema (structure and fields)
Schema() *types.FormSchema
// Fill fills the form with the provided data and returns modified PDF bytes
Fill(pdfBytes []byte, data types.FormData, password []byte, verbose bool) ([]byte, error)
// Validate validates form data against the form's validation rules
Validate(data types.FormData) []error
// GetValues returns the current values of all form fields
GetValues() map[string]interface{}
}
Form represents a unified form interface
type XFAFormWrapper ¶
type XFAFormWrapper struct {
// contains filtered or unexported fields
}
XFAFormWrapper wraps XFA form data to implement the Form interface
func (*XFAFormWrapper) GetValues ¶
func (w *XFAFormWrapper) GetValues() map[string]interface{}
func (*XFAFormWrapper) Schema ¶
func (w *XFAFormWrapper) Schema() *types.FormSchema
func (*XFAFormWrapper) Type ¶
func (w *XFAFormWrapper) Type() FormType
Click to show internal directories.
Click to hide internal directories.