@@ -810,8 +810,8 @@ public String compareDocumentInfo(String outPdf, String cmpPdf, byte[] outPass,
810
810
PdfReader readerCmp = new PdfReader (cmpPdf , getCmpReaderProperties ());
811
811
PdfDocument cmpDocument = new PdfDocument (readerCmp ,
812
812
new DocumentProperties ().setEventCountingMetaInfo (metaInfo ))) {
813
- String [] cmpInfo = convertInfo (cmpDocument .getDocumentInfo ());
814
- String [] outInfo = convertInfo (outDocument .getDocumentInfo ());
813
+ String [] cmpInfo = convertDocInfoToStrings (cmpDocument .getDocumentInfo ());
814
+ String [] outInfo = convertDocInfoToStrings (outDocument .getDocumentInfo ());
815
815
for (int i = 0 ; i < cmpInfo .length ; ++i ) {
816
816
if (!cmpInfo [i ].equals (outInfo [i ])) {
817
817
message = MessageFormatUtil .format ("Document info fail. Expected: \" {0}\" , actual: \" {1}\" " , cmpInfo [i ], outInfo [i ]);
@@ -926,7 +926,16 @@ public String compareTagStructures(String outPdf, String cmpPdf) throws IOExcept
926
926
return message ;
927
927
}
928
928
929
- String [] convertInfo (PdfDocumentInfo info ) {
929
+ /**
930
+ * Converts document info into a string array.
931
+ * <p>
932
+ * Converts document info into a string array. It can be used to compare PdfDocumentInfo later on.
933
+ * Default implementation retrieves title, author, subject, keywords and producer.
934
+ *
935
+ * @param info an instance of PdfDocumentInfo to be converted.
936
+ * @return String array with all the document info tester is interested in.
937
+ */
938
+ protected String [] convertDocInfoToStrings (PdfDocumentInfo info ) {
930
939
String [] convertedInfo = new String []{"" , "" , "" , "" , "" };
931
940
String infoValue = info .getTitle ();
932
941
if (infoValue != null )
@@ -1813,7 +1822,7 @@ private static class PngFileFilter implements FileFilter {
1813
1822
private String currentOutPdfName ;
1814
1823
1815
1824
public PngFileFilter (String currentOutPdfName ) {
1816
- this .currentOutPdfName = currentOutPdfName ;
1825
+ this .currentOutPdfName = currentOutPdfName ;
1817
1826
}
1818
1827
1819
1828
public boolean accept (File pathname ) {
0 commit comments