Skip to content

Commit 4e0e0db

Browse files
committed
Fix #1049
1 parent 1e4cb9f commit 4e0e0db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/pdfcpu/validate/annotation.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package validate
1818

1919
import (
2020
"strconv"
21+
"strings"
2122

2223
"github.com/pdfcpu/pdfcpu/pkg/log"
2324
"github.com/pdfcpu/pdfcpu/pkg/pdfcpu"
@@ -117,7 +118,11 @@ func validateBorderStyleDict(xRefTable *model.XRefTable, d types.Dict, dictName,
117118
validate := func(s string) bool { return types.MemberOf(s, []string{"S", "D", "B", "I", "U", "A"}) }
118119
_, err = validateNameEntry(xRefTable, d1, dictName, "S", OPTIONAL, model.V10, validate)
119120
if err != nil {
120-
return err
121+
if !strings.Contains(err.Error(), "invalid dict entry") {
122+
return err
123+
}
124+
// The PDF spec mandates interpreting undefined values as "S".
125+
err = nil
121126
}
122127

123128
// D, optional, dash array

0 commit comments

Comments
 (0)