ITEXT页脚/页眉中的内容对齐方式

ITEXT页脚/页眉中的内容对齐方式,itext,Itext,嗨 过去几天我一直在使用itext,在调整页脚内容方面遇到了困难。。如果页脚中有两行或多行,是否有方法以不同方式对齐每行。。我试着用下面的方法做这件事,但没有成功 Paragraph footerInfo = new Paragraph("Date :-",FontFactory.getFont("Calibri",9,Font.BOLD)); footerInfo.add("\n"); footerInfo.add(new Paragraph("Place :- "",FontFac

过去几天我一直在使用itext,在调整页脚内容方面遇到了困难。。如果页脚中有两行或多行,是否有方法以不同方式对齐每行。。我试着用下面的方法做这件事,但没有成功

Paragraph footerInfo = new Paragraph("Date :-",FontFactory.getFont("Calibri",9,Font.BOLD));   
 footerInfo.add("\n");
 footerInfo.add(new Paragraph("Place :- "",FontFactory.getFont("Calibri",9,Font.BOLD)));

Paragraph foot1 = new Paragraph("EmpID:-",FontFactory.getFont("Calibri",9,Font.BOLD));
          foot1.setAlignment(Element.ALIGN_RIGHT);
          footerInfo.add(foot1);


  HeaderFooter footer = new HeaderFooter(footerInfo, false);
    footer.setBorder(Rectangle.TOP);
    document.setFooter(footer);

HeaderFooter多年来一直不是使用iText创建页眉和页脚的首选机制。查看页面事件。在onEndPage页面事件中,您可以在页面的任何位置放置任意数量的文本片段。mkl所说的是正确的。您使用的是2009年从iText中删除的类,因此您使用的是非常旧且完全不受支持的iText版本。请升级到最新版本。如果您需要更多理由停止使用过时版本的iText,请阅读感谢您的评论。。我将研究一下最近的版本,并设法解决这个问题。。