Versions in this module Expand all Collapse all v0 v0.1.0 Oct 25, 2026 Changes in this version + var ErrLocked = errors.New("xfa: the field is locked") + var ErrNoField = errors.New("xfa: no field has that SOM path") + var ErrNoXFA = errors.New("xfa: the PDF has no XFA form") + var ErrSigned = errors.New("xfa: the field is already signed") + func CompleteChain(chain []*x509.Certificate, client *http.Client) ([]*x509.Certificate, error) + func FetchOCSP(chain []*x509.Certificate, client *http.Client) ([][]byte, error) + func Flatten(doc *Doc) ([]byte, error) + func TimestampAuthority(url string, client *http.Client) func(signature []byte) ([]byte, error) + func ViewerCSS() string + func ViewerHTML(doc *Doc, o ViewerOptions) []byte + func ViewerJS() string + type Doc struct + Dynamic bool + Fonts []Font + Pages []Page + type Edge struct + Color string + Dash string + W float64 + type Field struct + Bound bool + Comb int + Display string + Hidden bool + Kind string + Label string + MaxChars int + Name string + On string + Options []string + ReadOnly bool + Required bool + SOM string + Saves []string + Tip string + Value string + type FieldBox struct + Comb int + Display string + Font int + Group string + HAlign string + ISO string + Kind string + Mark string + MaxChars int + On string + Options []string + Page string + ReadOnly bool + Required bool + SOM string + Saves []string + Shape string + Signed bool + Tip string + VAlign string + Value string + type Font struct + Bold bool + Color string + HScale float64 + Italic bool + Size float64 + Strike bool + Typeface string + Underline bool + type Form struct + func Open(pdf []byte) (f *Form, err error) + func (f *Form) DataXML() []byte + func (f *Form) Dynamic() bool + func (f *Form) Fields() []Field + func (f *Form) Handler(o HandlerOptions) http.Handler + func (f *Form) Layout() (doc *Doc, err error) + func (f *Form) Save() ([]byte, error) + func (f *Form) Set(som, value string) error + func (f *Form) SetValues(vals map[string]string) error + func (f *Form) Sign(o SignOptions) ([]byte, error) + func (f *Form) SignatureFields() []SignatureField + func (f *Form) Signed() bool + func (f *Form) Value(som string) (string, bool) + func (f *Form) Values() map[string]string + type HandlerOptions struct + Save func(pdf []byte) error + Sign func(field string) (SignOptions, error) + SignatureText string + Title string + type Inst struct + Kids []*Inst + Kind string + Name string + Parent *Inst + Presence string + SOM string + T *Node + type Item struct + Clip bool + Edges []Edge + Field *FieldBox + Fill string + H float64 + Items []Item + Lines []TextLine + NoPrint bool + Radius float64 + Rot float64 + Src string + T string + W float64 + X float64 + X2 float64 + Y float64 + Y2 float64 + type Node struct + Attrs []xml.Attr + Kids []*Node + Kind NodeKind + Local string + Parent *Node + Space string + Text string + func NewElem(qname string) *Node + func ParseXML(b []byte) (*Node, error) + func (n *Node) Append(k *Node) *Node + func (n *Node) Attr(local string) string + func (n *Node) Bytes() []byte + func (n *Node) Child(local string) *Node + func (n *Node) Children(local string) []*Node + func (n *Node) DelAttr(local string) + func (n *Node) Elems() []*Node + func (n *Node) FindID(id string) *Node + func (n *Node) FirstElem() *Node + func (n *Node) HasAttr(local string) bool + func (n *Node) Index() int + func (n *Node) Path(names ...string) *Node + func (n *Node) QName() string + func (n *Node) Remove(k *Node) + func (n *Node) SetAttr(local, v string) + func (n *Node) SetText(s string) + func (n *Node) String() string + func (n *Node) TextContent() string + type NodeKind uint8 + const CommentNode + const DirectiveNode + const DocNode + const ElemNode + const ProcInstNode + const TextNode + type Page struct + H float64 + Items []Item + W float64 + type SignOptions struct + CAdES bool + CRLs [][]byte + Chain []*x509.Certificate + ContactInfo string + Field string + Location string + Name string + OCSP [][]byte + Reason string + Signer crypto.Signer + Time time.Time + Timestamp func(signature []byte) ([]byte, error) + type SignatureField struct + Label string + Locks []string + Name string + SOM string + Signed bool + Signer string + Time time.Time + type TextLine struct + Runs []TextRun + W float64 + X float64 + Y float64 + type TextRun struct + Font int + Text string + W float64 + X float64 + type ViewerOptions struct + CanSign bool + Endpoint string + NoSave bool + SignatureText string + Title string