Type 'aspose.words.saving.IPageSavingCallback' is not an acceptable base type

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.

1 Like

@yueru Unfortunately, using callbacks in the Python version of Aspose.Words is not supported yet.

This feature request is logged in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-24685

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.