Hi Colin,
I tried the “writing pdf directly” method and still had the same problems. Please keep in mind that I’m only talking about small files here, so memory shouldn’t be an issue. On the second part of “how to convert a text file to PDF,” I mentioned in my first post that I tried that method – however, again the files are so small that memory really shouldn’t be playing a role here. One other thing, I’m in a situation where temp files are not desired, so I need to make this work with memory streams.
Hi Colin,
for sharing the details.
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34786. We
will investigate this issue in details and will keep you updated on the status
of a correction.
apologize for your inconvenience.
Hi Colin,
string inFile = “c:/pdftest/TestFile-500k.txt”;<o:p></o:p>
string outFile = "c:/pdftest/TestFile-500k_4930.pdf";
Document doc = new Document();
Page page = doc.Pages.Add();
System.IO.TextReader objReader = new System.IO.StreamReader(inFile);
// Read the file till the end of the file has come
do
{
//Create a new text paragraph & pass text to its constructor as argument
TextFragment t2 = new TextFragment(objReader.ReadLine());
// add the text object to paragraphs collection of section
page.Paragraphs.Add(t2);
// Read till the end of file
} while (objReader.Peek() != -1);
// Close the StreamReader object
objReader.Close();
doc.Save(outFile);
The issues you have found earlier (filed as PDFNEWNET-34786) have been fixed in Aspose.Pdf for .NET 8.3.0.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.