From d1d154c0fe2990f8dccc0c5397396b51498be35c Mon Sep 17 00:00:00 2001 From: Gunnsteinn Hall Date: Sat, 7 Sep 2019 13:14:54 +0000 Subject: [PATCH 1/6] Update version to 3.2.0 --- common/version.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/version.go b/common/version.go index e2c1f080f..9b99e39e0 100644 --- a/common/version.go +++ b/common/version.go @@ -11,12 +11,12 @@ import ( ) const releaseYear = 2019 -const releaseMonth = 8 -const releaseDay = 4 -const releaseHour = 11 -const releaseMin = 40 +const releaseMonth = 9 +const releaseDay = 7 +const releaseHour = 13 +const releaseMin = 10 // Version holds version information, when bumping this make sure to bump the released at stamp also. -const Version = "3.1.1" +const Version = "3.2.0" var ReleasedAt = time.Date(releaseYear, releaseMonth, releaseDay, releaseHour, releaseMin, 0, 0, time.UTC) From 527dd2ea63dd246e14e5d03069b7279b13bfc616 Mon Sep 17 00:00:00 2001 From: Adrian-George Bostan Date: Sat, 7 Sep 2019 17:27:41 +0300 Subject: [PATCH 2/6] Adapt travis script to use the examples development branch --- .travis/build_examples.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis/build_examples.sh b/.travis/build_examples.sh index c15c81061..b86188e20 100755 --- a/.travis/build_examples.sh +++ b/.travis/build_examples.sh @@ -3,11 +3,19 @@ repo_path="$HOME/projects/unipdf-examples" git clone https://github.com/unidoc/unipdf-examples.git $repo_path cd $repo_path -branch_name="v3" -if [[ `git ls-remote origin "$TRAVIS_BRANCH"` ]]; then - branch_name="$TRAVIS_BRANCH" +build_branch="$TRAVIS_BRANCH" +if [[ -n "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then + build_branch="$TRAVIS_PULL_REQUEST_BRANCH" +fi +if [[ -z "$build_branch" ]]; then + build_branch="development" +fi + +target_branch="development" +if [[ `git ls-remote origin "$build_branch"` ]]; then + target_branch="$build_branch" fi -git checkout $branch_name +git checkout $target_branch echo "replace github.com/unidoc/unipdf/v3 => $TRAVIS_BUILD_DIR" >> go.mod ./build_examples.sh From 01d5548a6316d778fcf6cd776c4f6a450ab947d1 Mon Sep 17 00:00:00 2001 From: Adrian-George Bostan Date: Sat, 7 Sep 2019 17:28:53 +0300 Subject: [PATCH 3/6] Adapt Jenkins file to use the examples development branch --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 37531cb56..f30b0aa0c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -86,7 +86,7 @@ node { sh("printenv") // Pull unipdf-examples from connected branch, or master otherwise. - def examplesBranch = "v3" + def examplesBranch = "development" // Check if connected branch is defined explicitly. def safeName = env.BRANCH_NAME.replaceAll(/[\/\.]/, '') From 58f450b4567999b4ce2b787d201fac86b4e378ac Mon Sep 17 00:00:00 2001 From: Bert Van Hauwaert Date: Thu, 3 Oct 2019 10:19:01 +0200 Subject: [PATCH 4/6] Copy action of annotation --- creator/text_chunk.go | 8 ++++++++ go.mod | 2 ++ 2 files changed, 10 insertions(+) diff --git a/creator/text_chunk.go b/creator/text_chunk.go index f88634d78..ee2956f88 100644 --- a/creator/text_chunk.go +++ b/creator/text_chunk.go @@ -26,6 +26,11 @@ type TextChunk struct { annotationProcessed bool } +// SetAnnotation sets a annotation on a TextChunk +func (tc *TextChunk) SetAnnotation(annotation *model.PdfAnnotation) { + tc.annotation = annotation +} + // newTextChunk returns a new text chunk instance. func newTextChunk(text string, style TextStyle) *TextChunk { return &TextChunk{ @@ -85,6 +90,9 @@ func copyLinkAnnotation(link *model.PdfAnnotationLink) *model.PdfAnnotationLink annotation := model.NewPdfAnnotationLink() annotation.BS = link.BS annotation.A = link.A + if action, err := link.GetAction(); err == nil && action != nil { + annotation.SetAction(action) + } if annotDest, ok := link.Dest.(*core.PdfObjectArray); ok { annotation.Dest = core.MakeArray(annotDest.Elements()...) diff --git a/go.mod b/go.mod index 3e19193e5..72f1cadca 100644 --- a/go.mod +++ b/go.mod @@ -12,3 +12,5 @@ require ( golang.org/x/text v0.3.2 golang.org/x/tools v0.0.0-20190606174628-0139d5756a7d // indirect ) + +go 1.13 From 6b2b46b2744b13f528d53f0e7b94b68fe23146af Mon Sep 17 00:00:00 2001 From: Bert Van Hauwaert Date: Fri, 4 Oct 2019 21:03:56 +0200 Subject: [PATCH 5/6] Update text_chunk.go Add dot to comment --- creator/text_chunk.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/creator/text_chunk.go b/creator/text_chunk.go index ee2956f88..5a664bc8d 100644 --- a/creator/text_chunk.go +++ b/creator/text_chunk.go @@ -26,7 +26,7 @@ type TextChunk struct { annotationProcessed bool } -// SetAnnotation sets a annotation on a TextChunk +// SetAnnotation sets a annotation on a TextChunk. func (tc *TextChunk) SetAnnotation(annotation *model.PdfAnnotation) { tc.annotation = annotation } From 2995ee5260e0d00c1c5ce509c1b222196573c84c Mon Sep 17 00:00:00 2001 From: Bert Van Hauwaert Date: Fri, 4 Oct 2019 21:04:27 +0200 Subject: [PATCH 6/6] Update go.mod Undo unwanted change --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index 72f1cadca..3e19193e5 100644 --- a/go.mod +++ b/go.mod @@ -12,5 +12,3 @@ require ( golang.org/x/text v0.3.2 golang.org/x/tools v0.0.0-20190606174628-0139d5756a7d // indirect ) - -go 1.13