moneytriada.blogg.se

Use memory stream with pdfwriter
Use memory stream with pdfwriter







use memory stream with pdfwriter

Template.ShowText("" & Convert.ToString((writer.PageNumber - 1))) Public Overrides Sub OnCloseDocument(writer As PdfWriter, document As Document) Public Overrides Sub OnEndPage(writer As PdfWriter, document As Document)ĭim text As = "Page " & pageN & " de "ĭim len As Single = bf.GetWidthPoint(text, 8)Ĭb.SetTextMatrix(pageSize.GetLeft(40), pageSize.GetBottom(30))Ĭb.AddTemplate(template, pageSize.GetLeft(40) + len, pageSize.GetBottom(30))Ĭb.ShowTextAligned(PdfContentByte.ALIGN_RIGHT, "Imprimé le : " & PrintTime.ToShortDateString() & " à " & PrintTime.ToShortTimeString, pageSize.GetRight(40), pageSize.GetBottom(30), 0) Public Overrides Sub OnStartPage(writer As PdfWriter, document As Document)ĭim pageSize As Rectangle = document.PageSize Public Overrides Sub OnOpenDocument(writer As PdfWriter, document As Document)īf = BaseFont.CreateFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED) Private PrintTime As DateTime = DateTime.Now

use memory stream with pdfwriter

' this is the BaseFont we are going to use for the header / footer ' we will put the final number of pages in a template ' This is the contentbyte object of the writer Then override theses two functions like this : Imports You can create a class that inherits from PdfPageEventHelper









Use memory stream with pdfwriter