Skip to content

Commit

Permalink
Fix boolean output.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee authored and phpdave11 committed Dec 12, 2021
1 parent cf771f6 commit 1f10f98
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"crypto/sha1"
"encoding/hex"
"fmt"
"github.com/pkg/errors"
"math"
"os"

"github.com/pkg/errors"
)

type PdfWriter struct {
Expand Down Expand Up @@ -227,7 +228,7 @@ func (this *PdfWriter) endObj() {

func (this *PdfWriter) shaOfInt(i int) string {
hasher := sha1.New()
hasher.Write([]byte(fmt.Sprintf("%s-%s", i, this.r.sourceFile)))
hasher.Write([]byte(fmt.Sprintf("%d-%s", i, this.r.sourceFile)))
sha := hex.EncodeToString(hasher.Sum(nil))
return sha
}
Expand Down Expand Up @@ -323,9 +324,9 @@ func (this *PdfWriter) writeValue(value *PdfValue) {

case PDF_TYPE_BOOLEAN:
if value.Bool {
this.straightOut("true")
this.straightOut("true ")
} else {
this.straightOut("false")
this.straightOut("false ")
}
break

Expand Down

0 comments on commit 1f10f98

Please sign in to comment.