我正在寻找Concat /将多个PDF合并为一个PDF . 每个原始PDF都需要在最终PDF中的新页面上开始 . 另外,我需要在最终PDF的每个页面添加一个页脚,左边是文件标识符,中间是Y的页面X,右边是时间戳 . 使用iTextSharp时,我可以使用PDFWriter,修改页面事件处理程序,并创建页脚表 . 这是创建页脚的最简单方法吗?当我建造一张 table 时,我遇到了“Y页面X”的总数问题 . 你如何在表格中生成Y?

public override void OnEndPage(PdfWriter writer, Document doc)
{
    PdfPTable footerTable = new PdfPTable(3);

    footerTable.TotalWidth = doc.PageSize.Width;

    footerTable.HorizontalAlignment = Element.ALIGN_CENTER;

    Paragraph documentID = new Paragraph("Document ID: " + docID, footer);

    Paragraph pageNumbers = new Paragraph("Page " + writer.PageNumber.ToString() + " of " + **Y**, footer);

    Paragraph time = new Paragraph(timeStamp, footer);
}

至于使用PDFWriter合并文档,它会在每个文档的开头给我一个分页符,然后写入最终的PDF吗?