Hi,
I am trying to import a simple Html table and then export this to Docx:
var htmlDoc = new RadDocument();
htmlDoc.Measure(RadDocument.MAX_DOCUMENT_SIZE);
htmlDoc.Arrange(new RectangleF(PointF.Empty, htmlDoc.DesiredSize));
var htmltable = "<html><body><table><tr><td>cell</td></tr></table></body></html>";
var import = new HtmlFormatProvider();
var export = new DocxFormatProvider();
using (var stream = new MemoryStream()){
var writer = new StreamWriter(stream);
writer.Write(htmltable);
writer.Flush();
stream.Seek(0, SeekOrigin.Begin);
htmlDoc = import.Import(stream);
}
var bytes = export.Export(htmlDoc);
On the last line I always get en exception saying :
"System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection."
Any ideas?
I am trying to import a simple Html table and then export this to Docx:
var htmlDoc = new RadDocument();
htmlDoc.Measure(RadDocument.MAX_DOCUMENT_SIZE);
htmlDoc.Arrange(new RectangleF(PointF.Empty, htmlDoc.DesiredSize));
var htmltable = "<html><body><table><tr><td>cell</td></tr></table></body></html>";
var import = new HtmlFormatProvider();
var export = new DocxFormatProvider();
using (var stream = new MemoryStream()){
var writer = new StreamWriter(stream);
writer.Write(htmltable);
writer.Flush();
stream.Seek(0, SeekOrigin.Begin);
htmlDoc = import.Import(stream);
}
var bytes = export.Export(htmlDoc);
On the last line I always get en exception saying :
"System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection."
Any ideas?