Node to HTML strings taking long time in conversion

Hi Team,

We are trying to convert nodes to HTML strings for a document(.docx) using aspose words in python, but the execution is taking ~ 500 ms for each node on my machine. For 10K nodes, total time taken for this increases significantly.

Please tell us what can be optimal way for this conversion for reducing the processing time.

I have attached sample 1 MB document and minimum reproducible code for the same. Please help.

Minimum reproducible Code :

import aspose.words as aw
from uuid import uuid4
from datetime import datetime

# Load license
license = aw.License()
license.set_license("Aspose Total Product Family license")

# Load the document
doc = aw.Document("<LOCAL PATH FOR 1mb.docx>")

# Set options
options = aw.saving.HtmlSaveOptions()
options.export_list_labels = options.export_list_labels.BY_HTML_TAGS
options.export_original_url_for_linked_images = True
options.export_images_as_base64 = True

for index, paragraph_object in enumerate(doc.get_child_nodes(aw.NodeType.PARAGRAPH, is_deep = True)):
    time1 = datetime.now()
    html_string = paragraph_object.to_string(options)
    time_difference = datetime.now() - time1
    print(time_difference.total_seconds())

1mb.docx (1 MB)

This topic has been moved to the related forum: Node to HTML strings taking long time in conversion - Free Support Forum - aspose.com