Image image = Image.GetInstance(Server.MapPath("~/Content/Upload/salma.jpg")) Ĭhunk = new Chunk("Name: Mrs. Paragraph line = new Paragraph(new Chunk(new .LineSeparator(0.0F, 100.0F, BaseColor.BLACK, Element.ALIGN_LEFT, 1))) ![]() To create a text, with Arial font, font-size as 20, font-weight as bold & italic and color of magenta, use chunk like this:Ĭhunk = new Chunk("This Month's Transactions of your Credit Card") Ĭhunk chunk = new Chunk("Your Credit Card Statement Report has been Generated", FontFactory.GetFont("Arial", 20, Font.BOLDITALIC, BaseColor.MAGENTA)) Let us discuss each of them: ChunkĬhunk is a building block of element through which you can add a text with a certain font. These are Paragraph, Image, Table, Chunk and so on. The iTextSharp provides lot of PDF elements which you can add to the PDF document. Response.AddHeader("content-disposition", "attachment filename=Credit-Card-Report.pdf") ![]() Response.ContentType = "application/pdf" Here you create PDF elements like paragraph, table, lines and so on. PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDoc, Response.OutputStream) *Creating iTextSharp’s Document & Writer*/ĭocument pdfDoc = new Document(PageSize.A4, 25, 25, 25, 15)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |