@@ -126,8 +126,9 @@ This file is part of the iText (R) project.
126
126
* for the content of the cmpDoc and "but was" part stands for the content of the outDoc.
127
127
*/
128
128
public class CompareTool {
129
+ private static final String FILE_PROTOCOL = "file://" ;
129
130
private static final String UNEXPECTED_NUMBER_OF_PAGES = "Unexpected number of pages for <filename>." ;
130
- private static final String DIFFERENT_PAGES = "File file:/// <filename> differs on page <pagenumber>." ;
131
+ private static final String DIFFERENT_PAGES = "File " + FILE_PROTOCOL + " <filename> differs on page <pagenumber>." ;
131
132
private static final String IGNORED_AREAS_PREFIX = "ignored_areas_" ;
132
133
133
134
private static final String VERSION_REGEXP = "(iText\u00ae ( pdfX(FA|fa)| DITO)?|iTextSharp\u2122 ) (\\ d+\\ .)+\\ d+(-SNAPSHOT)?" ;
@@ -1057,7 +1058,8 @@ private String compareImagesOfPdfs(String outPath, String differenceImagePrefix,
1057
1058
if (!imageMagickHelper .runImageMagickImageCompare (imageFiles [i ].getAbsolutePath (),
1058
1059
cmpImageFiles [i ].getAbsolutePath (), diffName )) {
1059
1060
File diffFile = new File (diffName );
1060
- differentPagesFail += "\n Please, examine " + "file:///" + UrlUtil .toNormalizedURI (diffFile ).getPath () + " for more details." ;
1061
+ differentPagesFail += "\n Please, examine " + FILE_PROTOCOL
1062
+ + UrlUtil .toNormalizedURI (diffFile ).getPath () + " for more details." ;
1061
1063
}
1062
1064
}
1063
1065
System .out .println (differentPagesFail );
@@ -1150,8 +1152,10 @@ private void prepareOutputDirs(String outPath, String differenceImagePrefix) {
1150
1152
}
1151
1153
1152
1154
private void printOutCmpDirectories () {
1153
- System .out .println ("Out file folder: file://" + UrlUtil .toNormalizedURI (new File (outPdf ).getParentFile ()).getPath ());
1154
- System .out .println ("Cmp file folder: file://" + UrlUtil .toNormalizedURI (new File (cmpPdf ).getParentFile ()).getPath ());
1155
+ System .out .println ("Out file folder: " + FILE_PROTOCOL
1156
+ + UrlUtil .toNormalizedURI (new File (outPdf ).getParentFile ()).getPath ());
1157
+ System .out .println ("Cmp file folder: " + FILE_PROTOCOL
1158
+ + UrlUtil .toNormalizedURI (new File (cmpPdf ).getParentFile ()).getPath ());
1155
1159
}
1156
1160
1157
1161
private String compareByContent (String outPath , String differenceImagePrefix , Map <Integer , List <Rectangle >> ignoredAreas ) throws InterruptedException , IOException {
0 commit comments