Hi,
When I convert the attached Word file in HTML :
Document doc = new Document(docFile);
doc.Save(htmlFile, SaveFormat.Html);
The text content on the textbox shape is now part of the image, stopping me from manipulating this content. Is there a way to have the text from the textbox rendered as text in the html ?
PS: I tried to use the HtmlFixed format, but it’s not acceptable for us to have a span around each word.
Thank you,
Boris
Hi Boris,
Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your document to HTML using MS Word, you will get the same output.
Please use the Shape.ToString(SaveFormat.Text) method to get the text of Shape node. Following code example shows how to replace Shape node with shape’s text. Hope this helps you. Please let us know if you have any more queries.
Document doc = new Document(MyDir + "Sample.docx");
foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))
{
if (shape.TextBox != null)
{
Console.WriteLine(shape.ToString(SaveFormat.Text));
Paragraph para = shape.ParentParagraph;
shape.Remove();
para.AppendChild(new Run(doc, shape.ToString(SaveFormat.Text)));
}
}
doc.Save(MyDir + "Out.html");
Hi Boris,
Thanks for your request. We have also logged your requirement in our issue tracking system as WORDSNET-10041. Our development team will further look into the details of this requirement and we will keep you updated on the progress. We apologize for any inconvenience.
Best regards,
Hi Tahir,
This assumption:
Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your document to HTML using MS Word, you will get the same output.
is wrong, open the attached document and save it as html, you will see what I am talking about. So there is definitely a bug on your side, it would be good if you can acknowledge it.
Regards,
Boris
Hi Boris,
Thanks for your inquiry. Please note that
Aspose.Words mimics the same behavior as MS Word does. Aspose.Words
converts the MS Word documents to html (MS Word save option “Web Page, Filtered”) If you convert your document to HTML by using MS Word, you will get the same output.
Moreover,
upon processing HTML, some features of HTML might be lost. You can find
a list of limitations upon HTML exporting/importing here:
https://docs.aspose.com/words/net/load-in-the-html-html-xhtml-mhtml-format/
https://docs.aspose.com/words/net/save-in-html-xhtml-mhtml-formats/
We have logged the requested feature as WORDSNET-10041 in our issue tracking system. We will update you via this forum thread once this feature is available. We apologize for any inconvenience.
The issues you have found earlier (filed as WORDSNET-10041) have been fixed in this Aspose.Words for .NET 16.8.0 update and this Aspose.Words for Java 16.8.0 update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.