I’m using the following code to load a text file
Dim mDocument As New Aspose.Words.Document
Dim builder As Aspose.Words.DocumentBuilder = New Aspose.Words.DocumentBuilder(mDocument)
Dim oRead As System.IO.StreamReader
oRead = File.OpenText(e.Item.Path)
Dim LineIn As String = ""
While oRead.Peek <> -1
LineIn = oRead.ReadLine()
builder.Writeln(LineIn)
End While
Dim ms As New MemoryStream
mDocument.Save(ms, Aspose.Words.SaveFormat.Pdf)
PdfDocument.Load(ms)
oRead.Close()
And it locks up at mDocument.Save. If I change the saveFormat to doc or html it is fine. Is there something that I’m doing wrong?
Is this the preferred method to load text files?
Thanks,
Bill