We have some code that converts a simple text file to a PDF file using Aspose.Words 6.1.0.0.
This works well, but on our test document (1MB of text) this takes several minutes (02:30) to complete.
Adding the lines to the document is blazing fast (milliseconds), the command that is taking up all the time is doc.Save(pdfStream, SaveFormat.Pdf);
THe logic we use to convert text to a Document is as follows:
private Document ConvertTextToWord(Stream textStream)
{
// This object will help us generate the document.
DocumentBuilder builder = new DocumentBuilder();
// Use a StreamReader to read the text document.
using (StreamReader reader = new StreamReader(textStream, Encoding.Default, true))
{
// Read plain text “lines” and convert them into paragraphs in the document.
while (true)
{
string line = reader.ReadLine();
if (line != null)
{
builder.Writeln(line);
}
else
{
break;
}
}
}
return builder.Document;
}
Source and converted files have been attached.
Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your request. It seems to be a known issue #7490 in our defect database. I will notify you as soon as it is fixed.
Best regards.
It now takes 30 seconds, which is still not great, but an improvement nevertheless.
Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Thanks for your request. I also think that it is too slow and I created one more issue in our defect database (#7666). We will try to improve performance.
Best regards.
This issue has been open for some time. I checked it recently and Aspose.Words converts this document in 6 seconds, which is good, I will close the issue.
The issues you have found earlier (filed as WORDSNET-2118) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.