itext - Multiple PDF From Original PDF using iTextSharp -
i'm using itextsharp create invoice in pdf.
now need create multiple copies of pdf, adding headers such "duplicate", "triplicate", , on.
is possible?
document pdfdoc = new document(pagesize.a4, 20, 25, 25, 10); system.io.filestream file = new system.io.filestream(server.mappath("~/" + fileuploadloc + "/" + "file.pdf", system.io.filemode.openorcreate); pdfwriter pdfwriter = pdfwriter.getinstance(pdfdoc, file); filename = convert.tostring("invoice.pdf"); pdfdoc.open(); pdfwriter.open(); pdfptable nested = new pdfptable(1); nested.defaultcell.border = rectangle.box; nested.widthpercentage = 100; pdfpcell tableheader = new pdfpcell(new phrase("company name", titleheaderfont)); tableheader.horizontalalignment = 1; tableheader.border = rectangle.left_border | rectangle.right_border | rectangle.top_border; tableheader.left = 45f; tableheader.right = 45f; table.addcell(tableheader); pdfpcell tableheader7 = new pdfpcell(new phrase("triplicate supplier", fontsize7normaol));
////above line has changed in each new pdf
tableheader7.horizontalalignment = 1; tableheader7.border = rectangle.left_border | rectangle.right_border | rectangle.bottom_border | rectangle.top_border; tableheader7.right = 25f; nested1.addcell(tableheader7); pdfdoc.add(table); pdfwriter.closestream = false; pdfdoc.close();
Comments
Post a Comment