Remove Footer from PDF using IText5.0

Deadly 提交于 2021-02-19 04:48:07

问题


I need to be able to add this code ... I want to modify to this code to add/edit/remove headers and footers from the PDF.

public void onEndPage(PdfWriter writer, Document document)
{
    PdfContentByte cb = writer.getDirectContent();
    if (document.getPageNumber() > 1)
    {
        ColumnText.showTextAligned(cb, Element.ALIGN_CENTER, header, (document.right() - document
                                   .left())
                                   / 2 + document.leftMargin(), document.top() + 10, 0);
    }
    footer.writeSelectedRows(0, -1, (document.right() - document.left() - 300) / 2
                             + document.leftMargin(), document.bottom() - 10, cb);
}

Any suggestion please?

iText Pdf Header Removal for particular page

This link shows how to use HeaderFooter Class. Please share Itext2.X.jar file

来源:https://stackoverflow.com/questions/13580619/remove-footer-from-pdf-using-itext5-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!