haha, how aboutPDF component
http://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html , look this, it may help you to convert .txt to PDF clearly :
Private Shared Sub DrawText(section As PdfSection)
Dim text As String = File.ReadAllText("..\..\test.txt")
Dim page As PdfPageBase = section.Pages.Add()
Dim font As New PdfFont(PdfFontFamily.Helvetica, 11)
Dim format As New PdfStringFormat()
format.LineSpacing = 20F
Dim pageWidth As Single = page.Canvas.ClientSize.Width
Dim brush As PdfBrush = PdfBrushes.LightSeaGreen
Dim y As Single = 30
Dim textLayouter As New PdfStringLayouter()
Dim result As PdfStringLayoutResult = textLayouter.Layout(text, font, format, New SizeF(pageWidth, 0))
For Each line As LineInfo In result.Lines
page.Canvas.DrawString(line.Text, font, brush, 0, y, format)
y = y + result.LineHeight
Never give up! Smile to the world!
http://excelcsharp.blog.com/
Mahe, if this helps please login to Mark As Answer. | Alert Moderator