File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -675,10 +675,13 @@ func pageAnnotIndRefForAcroField(xRefTable *model.XRefTable, indRef types.Indire
675675
676676 var apObjNr int
677677 indRef1 := d .IndirectRefEntry ("AP" )
678- if indRef1 != nil {
679- apObjNr = indRef1 .ObjectNumber .Value ()
678+ if indRef1 == nil && (r .Width () == 0 && r .Height () == 0 ) {
679+ // Probably a signature field.
680+ return & indRef , nil
680681 }
681682
683+ apObjNr = indRef1 .ObjectNumber .Value ()
684+
682685 for _ , m := range xRefTable .PageAnnots {
683686 annots , ok := m [model .AnnWidget ]
684687 if ok {
@@ -690,7 +693,7 @@ func pageAnnotIndRefForAcroField(xRefTable *model.XRefTable, indRef types.Indire
690693 }
691694 }
692695
693- return nil , nil
696+ return nil , errors . New ( "pdfcpu: can't repair form fields" )
694697}
695698
696699func validateFormFieldsAgainstPageAnnotations (xRefTable * model.XRefTable ) error {
@@ -704,9 +707,6 @@ func validateFormFieldsAgainstPageAnnotations(xRefTable *model.XRefTable) error
704707 if err != nil {
705708 return err
706709 }
707- if indRef == nil {
708- return errors .New ("pdfcpu: can't repair form fields" )
709- }
710710 arr1 = append (arr1 , * indRef )
711711 }
712712
You can’t perform that action at this time.
0 commit comments