I want to read the WORD file complete source code, the HTML source code is decided to document paragraphs, bold, wrap and the project number etc…
Thank you!
Read the source code, save to the database in the
班会心得
本周二,我们班在班委的带领下就"弘扬立创立新,争当校园先锋 "为主题展开了深刻又富有意义的班会,这次班会的宗旨是为我们树立正确的人生观,道德观及生命观。是集体的凝聚力更强,增进同学间的情谊,并且引导我们走向未来的目标,让我们的大学生活过的更有意义。
Hi Hao,
Thanks for your inquiry and sorry for the delayed response. Sure, you can either convert your HTML file to Word document formats (e.g. DOC/DOCX) or can insert HTML markup directly into an existing Word document by using DocumentBuilder.InsertHtml method. You can then save this Word document to database by using the code suggested in the following article:
https://docs.aspose.com/words/net/serialize-and-work-with-a-document-in-a-database/
I hope, this will help.
Best Regards,
HTML is not their own procedures to add in, but we want to read WORD documents author original layout format (such as bullets, paragraphs, bold, space, etc.)
Itself is not a HTML file is uploaded, the. DOC format WORD files, we want to be directly read WORD files in the HTML code, HTML code instead of insert
I will really appreciate if you help us. Waiting for your reply.
Hi Hao,
Thanks for the additional information. What I understand, you are uploading a Word document via ASP.NET
on the server and requiring to extract separate document elements such as headers, footers, paragraphs, tables, images, and others so that you can obtain the HTML markup code for every element to be able to store into database. If this is found to be the case, I think, you can extract content using the DocumentVisitor and insert it into intermediate documents and finally save those intermediate documents into HTML streams. I hope, this will help.
Please let me know if I can be of any further assistance.
Best Regards,
Hi Hao,
Thanks for your inquiry. According to my understanding you want to read the HTML of word document. The code below will help you out. If there is anything else you want to do then please provide us the sample project.
//
string wordFilePath = System.IO.Path.Combine(MapPath("bin"), "wordDocument.doc");
Document doc = new Document(wordFilePath);
System.IO.Stream stream = new System.IO.MemoryStream();
doc.Save(stream, SaveFormat.Html);
stream.Position = 0;
System.IO.StreamReader reader = new System.IO.StreamReader(stream);
string htmltext = reader.ReadToEnd();
//
Please feel free to reply if you still have any confusions or queries.
Best Regards,
Amir Ghias
I mean the WORD document is read out, and then save to the database, the large field of database to retain WORD document format, thank you!
Read the project symbol or project Numbers, become “?”
And still another problem is: if the document contains the picture uploading
Hi Hao,
Thanks for the additional information. I think, you can achieve this after using the code suggested in the following link:
https://docs.aspose.com/words/net/serialize-and-work-with-a-document-in-a-database/
Best Regards,
Problems of screenshots
Hi Hao,
Thanks for your inquiry. Could you please attach your input/output documents here for testing? I will investigate the issue on my side and provide you more information.
Best Regards,