@@ -63,6 +63,7 @@ This file is part of the iText (R) project.
63
63
64
64
import org .junit .Assert ;
65
65
import org .junit .BeforeClass ;
66
+ import org .junit .Ignore ;
66
67
import org .junit .Test ;
67
68
import org .junit .experimental .categories .Category ;
68
69
@@ -207,6 +208,45 @@ public void createEmptyDocumentWithAbcXmp() throws IOException, XMPException {
207
208
reader .close ();
208
209
}
209
210
211
+ @ Test
212
+ @ Ignore ("DEVSIX-1899: fails in .NET passes in Java" )
213
+ public void customXmpTest () throws IOException , InterruptedException {
214
+ String xmp = "<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d' bytes='770'?>\n " +
215
+ "\n " +
216
+ "<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'\n " +
217
+ " xmlns:iX='http://ns.adobe.com/iX/1.0/'>\n " +
218
+ "\n " +
219
+ " <rdf:Description about=''\n " +
220
+ " xmlns='http://ns.adobe.com/pdf/1.3/'\n " +
221
+ " xmlns:pdf='http://ns.adobe.com/pdf/1.3/'>\n " +
222
+ " <pdf:ModDate>2001-03-28T15:17:00-08:00</pdf:ModDate>\n " +
223
+ " <pdf:CreationDate>2001-03-28T15:19:45-08:00</pdf:CreationDate>\n " +
224
+ " </rdf:Description>\n " +
225
+ "\n " +
226
+ " <rdf:Description about=''\n " +
227
+ " xmlns='http://ns.adobe.com/xap/1.0/'\n " +
228
+ " xmlns:xap='http://ns.adobe.com/xap/1.0/'>\n " +
229
+ " <xap:ModifyDate>2001-03-28T15:17:00-08:00</xap:ModifyDate>\n " +
230
+ " <xap:CreateDate>2001-03-28T15:19:45-08:00</xap:CreateDate>\n " +
231
+ " <xap:MetadataDate>2001-03-28T15:17:00-08:00</xap:MetadataDate>\n " +
232
+ " </rdf:Description>\n " +
233
+ "\n " +
234
+ "</rdf:RDF>\n " +
235
+ "<?xpacket end='r'?>" ;
236
+ String outPath = destinationFolder + "customXmp.pdf" ;
237
+ String cmpPath = sourceFolder + "cmp_customXmp.pdf" ;
238
+
239
+ PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outPath ));
240
+ PdfPage page = pdfDoc .addNewPage ();
241
+ page .flush ();
242
+ pdfDoc .setXmpMetadata (xmp .getBytes (StandardCharsets .ISO_8859_1 ));
243
+ pdfDoc .close ();
244
+
245
+ CompareTool compareTool = new CompareTool ();
246
+ Assert .assertNull (compareTool .compareByContent (outPath , cmpPath , destinationFolder , "diff_customXmp_" ));
247
+ Assert .assertNull (compareTool .compareDocumentInfo (outPath , cmpPath ));
248
+ }
249
+
210
250
private byte [] removeAlwaysDifferentEntries (byte [] cmpBytes ) throws XMPException {
211
251
XMPMeta xmpMeta = XMPMetaFactory .parseFromBuffer (cmpBytes );
212
252
0 commit comments