Skip to content

Commit

Permalink
Fix #335, #358
Browse files Browse the repository at this point in the history
  • Loading branch information
hhrutter committed Jul 23, 2021
1 parent 64e3df6 commit c3eb4c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/api/test/bookmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func TestAddSimpleBookmarks(t *testing.T) {
// TODO Emoji support!

bms := []pdfcpu.Bookmark{
{PageFrom: 1, Title: "Page 1: Regular"},
{PageFrom: 2, Title: "Page 2: Bold", Bold: true},
{PageFrom: 1, Title: "Page 1: Applicant’s Form"},
{PageFrom: 2, Title: "Page 2: Bold 这是一个测试", Bold: true},
{PageFrom: 3, Title: "Page 3: Italic", Italic: true, Bold: true},
{PageFrom: 4, Title: "Page 4: Bold & Italic", Bold: true, Italic: true},
{PageFrom: 16, Title: "Page 16: The birthday of Smalltalk", Color: &bookmarkColor},
Expand Down
2 changes: 1 addition & 1 deletion pkg/pdfcpu/bookmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func createOutlineItemDict(ctx *Context, bms []Bookmark, parent *IndirectRef, pa

d := Dict(map[string]Object{
"Dest": Array{*pageIndRef, Name("Fit")},
"Title": StringLiteral(bm.Title),
"Title": StringLiteral(encodeUTF16String(bm.Title)),
"Parent": *parent},
)

Expand Down
Binary file modified pkg/samples/bookmarks/bookmarkSimple.pdf
Binary file not shown.

0 comments on commit c3eb4c0

Please sign in to comment.