Skip to content
This repository was archived by the owner on Jul 26, 2021. It is now read-only.

Commit 129e074

Browse files
koleslenaegorovpavel
authored andcommitted
Issue #47 | Added font color font size property for text annotations (#53)
1 parent 77c89a4 commit 129e074

File tree

7 files changed

+20
-7
lines changed

7 files changed

+20
-7
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
},
1818
"homepage": "https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-Java-Spring#readme",
1919
"dependencies": {
20-
"@groupdocs.examples.jquery/annotation": "^0.13.0",
21-
"@groupdocs.examples.jquery/common": "^0.13.0",
22-
"@groupdocs.examples.jquery/viewer": "^0.13.0"
20+
"@groupdocs.examples.jquery/annotation": "^0.14.0",
21+
"@groupdocs.examples.jquery/common": "^0.14.0",
22+
"@groupdocs.examples.jquery/viewer": "^0.14.0"
2323
},
2424
"devDependencies": {
2525
"gulp": "^4.0.0"

src/main/java/com/groupdocs/ui/annotation/annotator/AbstractTextAnnotator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ protected AnnotationInfo initAnnotationInfo() throws ParseException {
2020
annotationInfo.setFieldText(annotationData.getText());
2121
annotationInfo.setFontFamily(StringUtils.capitalize(annotationData.getFont()));
2222
annotationInfo.setFontSize(annotationData.getFontSize());
23+
annotationInfo.setFontColor(annotationData.getFontColor());
2324
return annotationInfo;
2425
}
2526

src/main/java/com/groupdocs/ui/annotation/annotator/TextFieldAnnotator.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public AnnotationInfo annotatePdf() throws ParseException {
3333
// Text field annotation
3434
AnnotationInfo textFieldAnnotation = initAnnotationInfo();
3535
textFieldAnnotation.setAnnotationPosition(new Point(annotationData.getLeft(), annotationData.getTop()));
36-
textFieldAnnotation.setFontColor(255);
3736
textFieldAnnotation.setBackgroundColor(16777215);
3837
return textFieldAnnotation;
3938
}
@@ -54,15 +53,13 @@ public AnnotationInfo annotateSlides() throws ParseException {
5453
public AnnotationInfo annotateImage() throws ParseException {
5554
// init possible types of annotations
5655
AnnotationInfo textFieldAnnotation = initAnnotationInfo();
57-
textFieldAnnotation.setFontColor(-15988609);
5856
return textFieldAnnotation;
5957
}
6058

6159
@Override
6260
public AnnotationInfo annotateDiagram() throws ParseException {
6361
// init possible types of annotations
6462
AnnotationInfo textFieldAnnotation = initAnnotationInfo();
65-
textFieldAnnotation.setFontColor(-15988609);
6663
return textFieldAnnotation;
6764
}
6865

src/main/java/com/groupdocs/ui/annotation/annotator/WatermarkAnnotator.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public AnnotationInfo annotateSlides() throws ParseException {
5151
public AnnotationInfo annotateImage() throws ParseException {
5252
// init possible types of annotations
5353
AnnotationInfo watermarkAnnotation = initAnnotationInfo();
54-
watermarkAnnotation.setFontColor(15988609);
5554
return watermarkAnnotation;
5655
}
5756

src/main/java/com/groupdocs/ui/annotation/entity/web/AnnotationDataEntity.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public class AnnotationDataEntity {
5858
* Imported annotations
5959
*/
6060
private boolean imported;
61+
/**
62+
* font color
63+
*/
64+
private int fontColor;
6165

6266
public int getId() {
6367
return id;
@@ -162,4 +166,12 @@ public boolean isImported() {
162166
public void setImported(boolean imported) {
163167
this.imported = imported;
164168
}
169+
170+
public int getFontColor() {
171+
return fontColor;
172+
}
173+
174+
public void setFontColor(int fontColor) {
175+
this.fontColor = fontColor;
176+
}
165177
}

src/main/java/com/groupdocs/ui/annotation/util/AnnotationMapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public AnnotationDataEntity[] mapForPage(AnnotationInfo[] annotations, int pageN
5252
public AnnotationDataEntity mapAnnotationDataEntity(AnnotationInfo annotationInfo) {
5353
AnnotationDataEntity annotation = new AnnotationDataEntity();
5454
annotation.setFont(annotationInfo.getFontFamily());
55+
annotation.setFontColor(annotationInfo.getFontColor());
5556
annotation.setFontSize(annotationInfo.getFontSize());
5657
Rectangle box = annotationInfo.getBox();
5758
annotation.setHeight(box.getHeight());

src/main/resources/templates/annotation.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
<link type="text/css" rel="stylesheet" th:href="@{'/assets/viewer/css/viewer.mobile.css'}"/>
1313
<link type="text/css" rel="stylesheet" th:href="@{'/assets/viewer/css/viewer-dark.css'}"/>
1414
<link type="text/css" rel="stylesheet" th:href="@{'/assets/annotation/css/annotation.css'}"/>
15+
<link type="text/css" rel="stylesheet" th:href="@{'/assets/annotation/css/bcPicker.css'}" />
16+
<link type="text/css" rel="stylesheet" th:href="@{'/assets/annotation/css/bcPicker.mobile.css'}" />
1517
<script type="text/javascript" th:src="@{'/assets/common/js/jquery.min.js'}"></script>
1618
<script type="text/javascript" th:src="@{'/assets/common/js/swiper.min.js'}"></script>
1719
<script type="text/javascript" th:src="@{'/assets/common/js/jquery-ui.min.js'}"></script>
@@ -22,6 +24,7 @@
2224
<script type="text/javascript" th:src="@{'/assets/common/js/jquery.timeago.js'}"></script>
2325
<script type="text/javascript" th:src="@{'/assets/annotation/js/svg.min.js'}"></script>
2426
<script type="text/javascript" th:src="@{'/assets/annotation/js/svg.draw.js'}"></script>
27+
<script type="text/javascript" th:src="@{'/assets/annotation/js/bcPicker.js'}"></script>
2528
<script type="text/javascript" th:src="@{'/assets/annotation/js/drawSvgAnnotation.js'}"></script>
2629
<script type="text/javascript" th:src="@{'/assets/annotation/js/drawTextAnnotation.js'}"></script>
2730
<script type="text/javascript" th:src="@{'/assets/annotation/js/annotation.js'}"></script>

0 commit comments

Comments
 (0)