We often get queries from customers who would like to convert their text files to PDF. We are often
We often get queries from customers who would like to convert their text files to PDF. We are often asked if we can quickly provide some code
Rate We often get queries from customers who would like to convert their text files to PDF. We are often
(2(2 Vote))
Dim tr As System.IO.TextReader = New StreamReader("test.txt")
'Instantiate Pdf pbject by calling its empty constructor
Dim pdf1 As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf()
'Create a new section in the Pdf object
Dim sec1 As Aspose.Pdf.Section = pdf1.Sections.Add()
'Create a new text paragraph and pass the text to its constructor as argument
Dim t2 As Aspose.Pdf.Text = New Aspose.Pdf.Text(tr.ReadToEnd())
sec1.Paragraphs.Add(t2)
pdf1.Save("test.Pdf")
[C#]
System.IO.TextReader tr = new StreamReader("test.txt");
//Instantiate Pdf pbject by calling its empty constructor
Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf();
//Create a new section in the Pdf object
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
//Create a new text paragraph and pass the text to its constructor as argument
Aspose.Pdf.Text t2 = new Aspose.Pdf.Text(tr.ReadToEnd());
sec1.Paragraphs.Add(t2);
pdf1.Save("test.Pdf");
We often get queries from customers who would like to convert their text files to PDF. We are often Comments
No comments yet — be the first to post one!
Post a Comment