how to add an image to my header in iText generated PDF?

后端 未结 4 1401
花落未央
花落未央 2021-01-13 01:39

I\'m using iText to generate a PDF. I created a custom PdfPageEventHelper to add a header (and footer) to each page.

My problem is I don\'t know how to add the imag

4条回答
  •  灰色年华
    2021-01-13 02:11

    Can you try

    img.setAbsolutePosition(10, 10);
    writer.getDirectContent().addImage(img);
    

    instead of

    document.add(img);
    

    inside onPageEnd?

提交回复
热议问题