Free Support Forum -

Convert to Plain text format

I was running the web sample to use Alternating Rows template and output in plain text. The plain text output does not convert table rows very well. I was expecting all cells on the same row to be converted to a line of text, instead the plain text file contains all table cells to be on separate lines. It makes the plain text file less readable.

Is there a way to improve the plain text conversion output using Aspose?

We have a need to convert our report to plain text. Currently our report is in RTF format and we use MS Rich Text control to convert to plain text. It can maintain row cells on the same text line.

We are looking to move away from RTF format and possibly adopt your library to our report generation as well as output to different formats.


Thanks for your request. As a very simple way, you can try using the following code:
Document doc = new Document(filename);
TxtSaveOptions opt = new TxtSaveOptions();
opt.PreserveTableLayout = true;
doc.Save(“out.txt”, opt);

Please see the following link for more information:

Best regards,

Thanks for your previous help. I was able to convert to much better formatted plain text however the table columns are converted with some narrow width such that most cell text are wrapping to next line.

Is there an option to turn off text wrapping in table cells?

Below is my current code:

TxtSaveOptions opt = new TxtSaveOptions();
opt.PreserveTableLayout = true;
opt.ExportHeadersFooters = false;
opt.PrettyFormat = true;
opt.SimplifyListLabels = true;
mainReport.Save(destFileName, opt);

I attached the original docx and the converted plain text file.