progress_callback property
LoadOptions.progress_callback property
Called during loading a document and accepts data about loading progress.
@property
def progress_callback(self) -> aspose.words.loading.IDocumentLoadingCallback:
...
@progress_callback.setter
def progress_callback(self, value: aspose.words.loading.IDocumentLoadingCallback):
...
Remarks
LoadFormat.DOCX, LoadFormat.FLAT_OPC, LoadFormat.DOCM, LoadFormat.DOTM, LoadFormat.DOTX, LoadFormat.MARKDOWN, LoadFormat.RTF, LoadFormat.WORD_ML, LoadFormat.DOC, LoadFormat.DOT, LoadFormat.ODT, LoadFormat.OTT formats supported.
Examples
Shows how to notify the user if document loading exceeded expected loading time (LoadingProgressCallback).
class LoadingProgressCallback(aw.loading.IDocumentLoadingCallback):
def __init__(self):
self.max_duration = 0.5
self.m_loading_started_at = datetime.datetime.now()
def notify(self, args):
from datetime import datetime
canceled_at = datetime.now()
elapsed_seconds = (canceled_at - self.loading_started_at).total_seconds()
if elapsed_seconds > self.max_duration:
raise Exception()
See Also
- module aspose.words.loading
- class LoadOptions