您可以在问题的编辑部分找到C#的解决方案. 特别感谢Bruno Lowagie
我正在尝试通过C#中的iTextSharp创建发票.当我尝试在每个页面上打印小计时,它工作得非常好,但是我遇到了问题.
以下是用于为产品创建表的代码的一部分:
PdfPTable table = new PdfPTable(5);
table.WidthPercentage = 100;
float[] widths = new float[] { 10f, 30f, 120f, 30f, 30f };
table.SetWidths(widths);
table.SkipLastFooter = true;
table.SpacingAfter = 10;
//Cells to Write Header & Footer
AddCell(table, "Pos.", PdfPCell.ALIGN_RIGHT, BORDER_LTB, 0);
AddCell(table, "Menge", PdfPCell.ALIGN_RIGHT, BORDER_TB);
AddCell(table, "Text", PdfPCell.ALIGN_LEFT, BORDER_TB);
AddCell(table, "Einzelpreis ", PdfPCell.ALIGN_RIGHT, BORDER_TB);
AddCell(table, "Summe", PdfPCell.ALIGN_RIGHT, BORDER_RTB);
AddCell(table, "SUBTOTAL", PdfPCell.ALIGN_LEFT, BORDER_LTB, 7, 4);
AddCell(table, "", PdfPCell.ALIGN_LEFT, BORDER_RTB);
table.HeaderRows = 2;
table.FooterRows = 1;
//Cells with positions of …Run Code Online (Sandbox Code Playgroud)