如何使用(C#)itextsharp附加file2.pdf中file1.pdf中的所有页面 insert page method.please提供示例代码。 我在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();