We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save doc file to html takes long time with high CPU consumption

Hi,

I am evaluating Aspose.Words for report generating.

When saving a doc file to docx it takes ~2sec, however when I save it as HTML it takes ~4min with 100% CPU.

I am attaching the documnet.

Thanks,

Yaron

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I cannot reproduce the problem on my side. I used the following code for testing:

//Open document

Document doc = new Document(@"Test178\test2.doc");

DateTime start;

TimeSpan duration;

//Save document in different formats

//DOC

start = DateTime.Now;

doc.Save(@"Test178\out.doc", SaveFormat.Doc);

duration = DateTime.Now - start;

Console.WriteLine("DOC: {0} sec", duration.TotalSeconds);

//DOCX

start = DateTime.Now;

doc.Save(@"Test178\out.docx", SaveFormat.Docx);

duration = DateTime.Now - start;

Console.WriteLine("DOCX: {0} sec", duration.TotalSeconds);

//HTML

start = DateTime.Now;

doc.Save(@"Test178\out.html", SaveFormat.Html);

duration = DateTime.Now - start;

Console.WriteLine("HTML: {0} sec", duration.TotalSeconds);

//PDF

start = DateTime.Now;

doc.Save(@"Test178\out.pdf", SaveFormat.Pdf);

duration = DateTime.Now - start;

Console.WriteLine("PDF: {0} sec", duration.TotalSeconds);

Here is my results:

In licensed mode:

DOC: 1,078125 sec

DOCX: 1,71875 sec

HTML: 1,65625 sec

PDF: 8,4375 sec

In evaluation mode:

DOC: 0,5 sec

DOCX: 0,75 sec

HTML: 0,453125 sec

PDF: 2,515625 sec

It is faster in evaluation mode, because document is truncated by evaluation restrictions.

I use the latest version of Aspose.Words for testing.

Also. I did the same for Java version:

//Open document

Document doc = new Document("C:\\Temp\\test2.doc");

Date start;

Date end;

double duration;

//Save document in different formats

//DOC

start = new Date();

doc.save("C:\\Temp\\out.doc", SaveFormat.DOC);

end = new Date();

duration = ((double)end.getTime() - (double)start.getTime()) / 1000;

System.out.println("DOC : " + duration + " sec");

//DOC

start = new Date();

doc.save("C:\\Temp\\out.docx", SaveFormat.DOCX);

end = new Date();

duration = ((double)end.getTime() - (double)start.getTime()) / 1000;

System.out.println("DOCX : " + duration + " sec");

//HTML

start = new Date();

doc.save("C:\\Temp\\out.html", SaveFormat.HTML);

end = new Date();

duration = ((double)end.getTime() - (double)start.getTime()) / 1000;

System.out.println("HTML : " + duration + " sec");

Here is my results:

In licensed mode:

DOC : 0.515 sec

DOCX : 1.063 sec

HTML : 6.609 sec

In evaluation mode:

DOC : 0.297 sec

DOCX : 0.906 sec

HTML : 2.0 sec

Best regards.