Skip to content

Commit

Permalink
Make float parsing more like gs
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwilliams97 committed Aug 7, 2017
1 parent f840c1c commit 9d09f7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pdf/contentstream/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ func (this *ContentStreamParser) parseNumber() (PdfObject, error) {

if isFloat {
fVal, err := strconv.ParseFloat(numStr, 64)
if err != nil {
common.Log.Error("Error parsing number %q err=%v. Using 0.0. Output may be incorrect", numStr, err)
fVal = 0.0
err = nil
}
o := PdfObjectFloat(fVal)
return &o, err
} else {
Expand Down

0 comments on commit 9d09f7a

Please sign in to comment.