Skip to content

Commit b7dc677

Browse files
authored
Merge pull request #176 from becoded/bugfix-text-chunk-annotation
Copy action of annotation
2 parents b063d02 + 2995ee5 commit b7dc677

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

.travis/build_examples.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ repo_path="$HOME/projects/unipdf-examples"
33
git clone https://github.com/unidoc/unipdf-examples.git $repo_path
44
cd $repo_path
55

6-
branch_name="v3"
7-
if [[ `git ls-remote origin "$TRAVIS_BRANCH"` ]]; then
8-
branch_name="$TRAVIS_BRANCH"
6+
build_branch="$TRAVIS_BRANCH"
7+
if [[ -n "$TRAVIS_PULL_REQUEST_BRANCH" ]]; then
8+
build_branch="$TRAVIS_PULL_REQUEST_BRANCH"
9+
fi
10+
if [[ -z "$build_branch" ]]; then
11+
build_branch="development"
12+
fi
13+
14+
target_branch="development"
15+
if [[ `git ls-remote origin "$build_branch"` ]]; then
16+
target_branch="$build_branch"
917
fi
1018

11-
git checkout $branch_name
19+
git checkout $target_branch
1220
echo "replace github.com/unidoc/unipdf/v3 => $TRAVIS_BUILD_DIR" >> go.mod
1321
./build_examples.sh

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ node {
8686
sh("printenv")
8787

8888
// Pull unipdf-examples from connected branch, or master otherwise.
89-
def examplesBranch = "v3"
89+
def examplesBranch = "development"
9090

9191
// Check if connected branch is defined explicitly.
9292
def safeName = env.BRANCH_NAME.replaceAll(/[\/\.]/, '')

common/version.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import (
1111
)
1212

1313
const releaseYear = 2019
14-
const releaseMonth = 8
15-
const releaseDay = 4
16-
const releaseHour = 11
17-
const releaseMin = 40
14+
const releaseMonth = 9
15+
const releaseDay = 7
16+
const releaseHour = 13
17+
const releaseMin = 10
1818

1919
// Version holds version information, when bumping this make sure to bump the released at stamp also.
20-
const Version = "3.1.1"
20+
const Version = "3.2.0"
2121

2222
var ReleasedAt = time.Date(releaseYear, releaseMonth, releaseDay, releaseHour, releaseMin, 0, 0, time.UTC)

creator/text_chunk.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ type TextChunk struct {
2626
annotationProcessed bool
2727
}
2828

29+
// SetAnnotation sets a annotation on a TextChunk.
30+
func (tc *TextChunk) SetAnnotation(annotation *model.PdfAnnotation) {
31+
tc.annotation = annotation
32+
}
33+
2934
// newTextChunk returns a new text chunk instance.
3035
func newTextChunk(text string, style TextStyle) *TextChunk {
3136
return &TextChunk{
@@ -85,6 +90,9 @@ func copyLinkAnnotation(link *model.PdfAnnotationLink) *model.PdfAnnotationLink
8590
annotation := model.NewPdfAnnotationLink()
8691
annotation.BS = link.BS
8792
annotation.A = link.A
93+
if action, err := link.GetAction(); err == nil && action != nil {
94+
annotation.SetAction(action)
95+
}
8896

8997
if annotDest, ok := link.Dest.(*core.PdfObjectArray); ok {
9098
annotation.Dest = core.MakeArray(annotDest.Elements()...)

0 commit comments

Comments
 (0)