I am evaluating aspose-words python version v23.1. I want to set page_saving_callback
in PdfSaveOptions
. But I got the exception:
TypeError: type 'aspose.words.saving.IPageSavingCallback' is not an acceptable base type
Code:
class WordPageSavingCallback(aspose.words.saving.IPageSavingCallback):
def page_saving(self, args: aspose.words.saving.PageSavingArgs):
print('test page saving call back')
if __name__ == '__main__':
document = aspose.words.Document('test.docx')
options = aspose.words.saving.PdfSaveOptions()
options.page_saving_callback = WordPageSavingCallback()
document.save("output.pdf", options)
Any sample source file test.docx
can reprodcue the issue.
Please let me know how to write a class inherits IPageSavingCallback
.