如何使用(C#)itextsharp
插入页面方法从 file2.pdf 附加 file1.pdf 中的所有页面。请提供示例代码。我在 itext pdf 上找到了此代码,请提供适用于 c# 的示例代码
ColumnText ct = new ColumnText(null);
while (rs.next()) {
ct.addElement(new Paragraph(24,
new Chunk(rs.getString("country"))));
}
PdfReader reader = new PdfReader(src);
PdfReader stationery = new PdfReader(Stationery.STATIONERY);
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(dest));
PdfImportedPage page = stamper.getImportedPage(stationery, 1);
int i = 0;
while(true) {
stamper.insertPage(++i, reader.getPageSize(1));
stamper.getUnderContent(i).addTemplate(page, 0, 0);
ct.setCanvas(stamper.getOverContent(i));
ct.setSimpleColumn(36, 36, 559, 770);
if (!ColumnText.hasMoreText(ct.go()))
break;
}
stamper.close();