Skip to content

Commit

Permalink
Fix #644
Browse files Browse the repository at this point in the history
  • Loading branch information
hhrutter committed Jun 30, 2023
1 parent df2a612 commit b17ba03
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pkg/pdfcpu/form/fill.go
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ func fillTextField(
}

vNew := vv[0]

if vNew == vOld {
return nil
}
Expand All @@ -917,15 +918,35 @@ func fillTextField(
if err != nil {
return err
}

d["V"] = types.StringLiteral(*s)

multiLine := ff != nil && uint(primitives.FieldFlags(*ff))&uint(primitives.FieldMultiline) > 0

kids := d.ArrayEntry("Kids")
if len(kids) > 0 {
for _, o := range kids {

d, err := ctx.DereferenceDict(o)
if err != nil {
return err
}

if err := primitives.EnsureTextFieldAP(ctx, d, vNew, multiLine, fonts); err != nil {
return err
}

*ok = true
}

return nil
}

if err := primitives.EnsureTextFieldAP(ctx, d, vNew, multiLine, fonts); err != nil {
return err
}

*ok = true

return nil
}

Expand Down

0 comments on commit b17ba03

Please sign in to comment.