Dim pdf As PdfDocument = New PdfDocument pdf.Info.Title = "My First PDF" Dim pdfPage As PdfPage = pdf.AddPage Dim graph As XGraphics = XGraphics.FromPdfPage(pdfPage) Dim font As XFont = New XFont("Verdana", 20, XFontStyle.Bold) graph.DrawString(Convert.ToString(txtdata.Text), font, XBrushes.Black, _ New XRect(0, 0, pdfPage.Width.Point, pdfPage.Height.Point), XStringFormats.Center) Dim pdfFilename As String = "firstpage.pdf" pdf.Save(pdfFilename) Process.Start(pdfFilename)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)