@Test
public void testImageChunkOnGenericTag() throws IOException, DocumentException, InterruptedException {

    String fileName = "testImageChunkOnGenericTag.pdf";
    FileOutputStream fos = new FileOutputStream(OUTFOLDER + fileName);
    Document doc = new Document(PageSize.LETTER);
    PdfWriter writer = PdfWriter.getInstance(doc, fos);
    writer.setPageEvent(new EventHandler());
    doc.open();
    Image img = Image.getInstance(writer.getDirectContent().createTemplate(100f, 25f));
    System.out.println(img.getHeight());
    Chunk c = new Chunk(img, 0, 0);
    c.setGenericTag("foobar");
    doc.add(c);
    doc.close();
    CompareTool compareTool = new CompareTool();
    String error = compareTool.compareByContent(OUTFOLDER + fileName, SOURCE_FOLDER + "cmp_" + fileName, OUTFOLDER, "diff_");
    if (error != null) {
        Assert.fail(error);
    }
}