Hi, I have a word, there is some point under the font char. like underline. So when I export them to html, it lost. how can I keep this? Thanks.
@ZZZ21321 Could you please attach your sample input document and output document here for our reference? We will check the issue and provide you more information.
@ZZZ21321 I was managed to reproduce your issue on my side. I have logged it as WORDSNET-24681 in our defect tracking system. We will keep you informed and let you know once it is resolved.
Thanks, can I get the position of start and end in python? Maybe I can add some marks before export. Is there any demo code?
@ZZZ21321 You can get the Run nodes that has emphasis mark set:
doc = aw.Document("C:\\Temp\\in.docx")
# Get all Run nodes in the document.
runs = doc.get_child_nodes(aw.NodeType.RUN, True)
# Print runs with emphasis mark.
for r in runs :
run = r.as_run()
if run.font.emphasis_mark != aw.EmphasisMark.NONE :
print(run.text)
print(run.font.emphasis_mark)
print("-----------------------------")
Thanks, if I want to find the footnotes.
# Print runs with emphasis mark.
for r in runs :
run = r.as_run()
if run.not.FootnoteType != aw.notes.FootnoteType.ENDNOTE :
print(run.text)
print("-----------------------------")
is this right?
@ZZZ21321 You can use code like this to get footnotes in your document:
doc = aw.Document("C:\\Temp\\in.docx")
# Get all Footnote nodes in the document.
notes = doc.get_child_nodes(aw.NodeType.FOOTNOTE, True)
# Print footnotes
for n in notes :
note = n.as_footnote()
if note.footnote_type == aw.notes.FootnoteType.FOOTNOTE :
print(note.to_string(aw.SaveFormat.TEXT).strip())
print("-----------------------------")
Dear, the code to extract all underline style is?
@ZZZ21321 You can use Font.underline property to detect whether text is underlined. For example see the following code:
doc = aw.Document("C:\\Temp\\in.docx")
# Get all Run nodes in the document.
runs = doc.get_child_nodes(aw.NodeType.RUN, True)
# Print runs with emphasis mark.
for r in runs :
run = r.as_run()
if run.font.underline != aw.Underline.NONE :
print(run.text)
print("-----------------------------")