@@ -40,6 +40,9 @@ var textAnn model.AnnotationRenderer = model.NewTextAnnotation(
4040 nil , // ca
4141 "" , // rc
4242 "" , // subject
43+ 0 , // borderRadX
44+ 0 , // borderRadY
45+ 2 , // borderWidth
4346 false , // displayOpen
4447 "Comment" ) // name
4548
@@ -55,6 +58,9 @@ var textAnnCJK model.AnnotationRenderer = model.NewTextAnnotation(
5558 nil , // ca
5659 "RC" , // rc
5760 "" , // subject
61+ 0 , // borderRadX
62+ 0 , // borderRadY
63+ 2 , // borderWidth
5864 true , // displayOpen
5965 "Comment" ) // name
6066
@@ -703,6 +709,9 @@ func TestPopupAnnotation(t *testing.T) {
703709 "" , // modDate
704710 0 , // f
705711 & color .Green , // col
712+ 0 , // borderRadX
713+ 0 , // borderRadY
714+ 2 , // borderWidth
706715 parentIndRef , // parentIndRef,
707716 false , // displayOpen
708717 )
@@ -775,6 +784,9 @@ func TestHighlightAnnotation(t *testing.T) {
775784 "" , // modDate
776785 model .AnnLocked , // f
777786 & color .Yellow , // col
787+ 0 , // borderRadX
788+ 0 , // borderRadY
789+ 2 , // borderWidth
778790 "Comment by Horst" , // title
779791 nil , // popupIndRef
780792 nil , // ca
@@ -808,6 +820,9 @@ func TestUnderlineAnnotation(t *testing.T) {
808820 "" , // modDate
809821 model .AnnLocked , // f
810822 & color .Yellow , // col
823+ 0 , // borderRadX
824+ 0 , // borderRadY
825+ 2 , // borderWidth
811826 "Title1" , // title
812827 nil , // popupIndRef
813828 nil , // ca
@@ -841,6 +856,9 @@ func TestSquigglyAnnotation(t *testing.T) {
841856 "" , // modDate
842857 model .AnnLocked , // f
843858 & color .Yellow , // col
859+ 0 , // borderRadX
860+ 0 , // borderRadY
861+ 2 , // borderWidth
844862 "Title1" , // title
845863 nil , // popupIndRef
846864 nil , // ca
@@ -874,6 +892,9 @@ func TestStrikeOutAnnotation(t *testing.T) {
874892 "" , // modDate
875893 model .AnnLocked , // f
876894 & color .Yellow , // col
895+ 0 , // borderRadX
896+ 0 , // borderRadY
897+ 2 , // borderWidth
877898 "Title1" , // title
878899 nil , // popupIndRef
879900 nil , // ca
@@ -1022,3 +1043,35 @@ func TestLineAnnotation(t *testing.T) {
10221043 t .Fatalf ("%s add: %v\n " , msg , err )
10231044 }
10241045}
1046+
1047+ func TestCaretAnnotation (t * testing.T ) {
1048+ msg := "TestCaretAnnotation"
1049+
1050+ // Best viewed with Adobe Reader.
1051+
1052+ inFile := filepath .Join (inDir , "test.pdf" )
1053+ outFile := filepath .Join (samplesDir , "annotations" , "CaretAnnotation.pdf" )
1054+
1055+ caretAnn := model .NewCaretAnnotation (
1056+ * types .NewRectangle (30 , 30 , 110 , 110 ), // rect
1057+ "Caret Annotation" , // contents
1058+ "IDCaret" , // id
1059+ "" , // modDate
1060+ 0 , // f,
1061+ nil , // col
1062+ 0 , // borderRadX
1063+ 0 , // borderRadY
1064+ 0 , // borderWidth
1065+ "Title1" , // title
1066+ nil , // popupIndRef
1067+ nil , // ca
1068+ "" , // rc
1069+ "" , // subject
1070+ types .NewRectangle (20 , 20 , 20 , 20 ), // RD
1071+ true ) // paragraph symbol
1072+
1073+ // Add line annotation.
1074+ if err := api .AddAnnotationsFile (inFile , outFile , nil , caretAnn , nil , false ); err != nil {
1075+ t .Fatalf ("%s add: %v\n " , msg , err )
1076+ }
1077+ }
0 commit comments