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

Free Support Forum - aspose.com

How to get the word of each page?

Hello,I am a .Net programmer. I was developing a website with asp.net mvc4,I had some questions,can you help me?

1.when the user in my website upload word file,I need to read user uploaded word file each page and converted to HTML.

For example: I posted a 3 page word file,when the word file uploaded successfully,I nend to read the first page and converted to 1.html,read the second page and converted to 2.html,read the third page and converted to 3.html.

When I use the doc.Save function is save all page in one HTML file,but I want to each page is saved to a separate HTML file.

Can you help me?

Hi,I know doc.Save() function save all page in one HTML file.

doc.RenderToScale() function save each page to the independent image file.
but i want read or save each page in independent HTML file,I had not idea,can you help me?

Hi,


Thanks for your inquiry. In this case, you can export pages of Word document to HtmlFixed format. The code to achieve this is as follows:

Document doc = new Document(MyDir + @“in.docx”);

for (int pageIndex = 0; pageIndex < doc.PageCount; pageIndex++)

{

HtmlFixedSaveOptions options = new HtmlFixedSaveOptions();

options.PageIndex = pageIndex;

options.PageCount = 1;

doc.Save(MyDir + "out_" + pageIndex + ".html", options);

}


I hope, this helps.

Best regards,

Thank you,this function save each page in independent page successfully,if I want to save each in database(sql server 2008) for HTML code,can you help me?

Hi,

Thanks for your inquiry. Please refer to the following article which I believe will help you in achieving what you are looking for:

Best regards,