@@ -71,56 +71,50 @@ public static void beforeClass() {
71
71
}
72
72
73
73
@ Test
74
- // TODO DEVSIX-8679 Apply links alternate description according to UA standard
75
74
public void simpleLinkTest () throws IOException , InterruptedException , XMPException {
76
75
String sourceHtml = SOURCE_FOLDER + "simpleLink.html" ;
77
76
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_simpleLinkUa1.pdf" ;
78
77
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_simpleLinkUa2.pdf" ;
79
- String destinationPdfUa1 = DESTINATION_FOLDER + "simpleLink .pdf" ;
80
- String destinationPdfUa2 = DESTINATION_FOLDER + "simpleLink .pdf" ;
78
+ String destinationPdfUa1 = DESTINATION_FOLDER + "simpleLinkUa1 .pdf" ;
79
+ String destinationPdfUa2 = DESTINATION_FOLDER + "simpleLinkUa2 .pdf" ;
81
80
82
- String expectedUa1Message = MessageFormatUtil .format (
83
- PdfUAExceptionMessageConstants .ANNOTATION_OF_TYPE_0_SHOULD_HAVE_CONTENTS_OR_ALT_KEY ,
84
- PdfName .Link .getValue ());
85
-
86
- convertToUa1AndCheckCompliance (sourceHtml , destinationPdfUa1 , cmpPdfUa1 , false , expectedUa1Message );
87
- // Expected valid UA-2 document because PDF/UA-2 does not require Contents in Link annotations
81
+ convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , true , null );
88
82
convertToUa2AndCheckCompliance (sourceHtml , destinationPdfUa2 , cmpPdfUa2 , true );
89
83
}
90
84
91
85
@ Test
92
- // TODO DEVSIX-8679 Apply links alternate description according to UA standard
93
86
public void backwardLinkTest () throws IOException , InterruptedException , XMPException {
94
87
String sourceHtml = SOURCE_FOLDER + "backwardLink.html" ;
95
88
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_backwardLinkUa1.pdf" ;
96
89
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_backwardLinkUa2.pdf" ;
97
90
String destinationPdfUa1 = DESTINATION_FOLDER + "backwardLinkUa1.pdf" ;
98
91
String destinationPdfUa2 = DESTINATION_FOLDER + "backwardLinkUa2.pdf" ;
99
92
100
- String expectedUa1Message = MessageFormatUtil .format (
101
- PdfUAExceptionMessageConstants .ANNOTATION_OF_TYPE_0_SHOULD_HAVE_CONTENTS_OR_ALT_KEY ,
102
- PdfName .Link .getValue ());
103
-
104
- convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , false , expectedUa1Message );
105
- // Expected valid UA-2 document because PDF/UA-2 does not require Contents in Link annotations
93
+ convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , true , null );
106
94
convertToUa2AndCheckCompliance (sourceHtml , destinationPdfUa2 , cmpPdfUa2 , true );
107
95
}
108
96
109
97
@ Test
110
- // TODO DEVSIX-8679 Apply links alternate description according to UA standard
111
98
public void imageLinkTest () throws IOException , InterruptedException , XMPException {
112
99
String sourceHtml = SOURCE_FOLDER + "imageLink.html" ;
113
100
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_imageLinkUa1.pdf" ;
114
101
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_imageLinkUa2.pdf" ;
115
102
String destinationPdfUa1 = DESTINATION_FOLDER + "imageLinkUa1.pdf" ;
116
103
String destinationPdfUa2 = DESTINATION_FOLDER + "imageLinkUa2.pdf" ;
117
104
118
- String expectedUa1Message = MessageFormatUtil . format (
119
- PdfUAExceptionMessageConstants . ANNOTATION_OF_TYPE_0_SHOULD_HAVE_CONTENTS_OR_ALT_KEY ,
120
- PdfName . Link . getValue ());
105
+ convertToUa1AndCheckCompliance ( sourceHtml , destinationPdfUa1 , cmpPdfUa1 , true , null );
106
+ convertToUa2AndCheckCompliance ( sourceHtml , destinationPdfUa2 , cmpPdfUa2 , true );
107
+ }
121
108
122
- convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , false , expectedUa1Message );
123
- // Expected valid UA-2 document because PDF/UA-2 does not require Contents in Link annotations
109
+ @ Test
110
+ public void externalLinkTest () throws IOException , InterruptedException , XMPException {
111
+ String sourceHtml = SOURCE_FOLDER + "externalLink.html" ;
112
+ String cmpPdfUa1 = SOURCE_FOLDER + "cmp_externalLinkUa1.pdf" ;
113
+ String cmpPdfUa2 = SOURCE_FOLDER + "cmp_externalLinkUa2.pdf" ;
114
+ String destinationPdfUa1 = DESTINATION_FOLDER + "externalLinkUa1.pdf" ;
115
+ String destinationPdfUa2 = DESTINATION_FOLDER + "externalLinkUa2.pdf" ;
116
+
117
+ convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , true , null );
124
118
convertToUa2AndCheckCompliance (sourceHtml , destinationPdfUa2 , cmpPdfUa2 , true );
125
119
}
126
120
@@ -225,19 +219,14 @@ public void pageBreakAfterAvoidTest() throws IOException, InterruptedException,
225
219
@ Test
226
220
// TODO DEVSIX-8864 PDF 2.0: Destination in GoTo action is not a structure destination
227
221
// TODO DEVSIX-8476 PDF 2.0 doesn't allow P tag be a child of H tag
228
- // TODO DEVSIX-8679 Apply links alternate description according to UA standard
229
222
public void linkWithPageBreakBeforeTest () throws IOException , InterruptedException , XMPException {
230
223
String sourceHtml = SOURCE_FOLDER + "linkWithPageBreakBefore.html" ;
231
224
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_linkWithPageBreakBeforeUa1.pdf" ;
232
225
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_linkWithPageBreakBeforeUa2.pdf" ;
233
226
String destinationPdfUa1 = DESTINATION_FOLDER + "linkWithPageBreakBeforeUa1.pdf" ;
234
227
String destinationPdfUa2 = DESTINATION_FOLDER + "linkWithPageBreakBeforeUa2.pdf" ;
235
228
236
- String expectedUa1Message = MessageFormatUtil .format (
237
- PdfUAExceptionMessageConstants .ANNOTATION_OF_TYPE_0_SHOULD_HAVE_CONTENTS_OR_ALT_KEY ,
238
- PdfName .Link .getValue ());
239
-
240
- convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , false , expectedUa1Message );
229
+ convertToUa1AndCheckCompliance (sourceHtml ,destinationPdfUa1 , cmpPdfUa1 , true , null );
241
230
convertToUa2AndCheckCompliance (sourceHtml , destinationPdfUa2 , cmpPdfUa2 , false );
242
231
}
243
232
0 commit comments