Skip to content

Using SlidesAsyncApi.startConvert fails with Deserialization Issue #4

@klein-artur

Description

@klein-artur

So I am using version 24.9.0, in a spring boot environment with kotlin.

Calling the startConvert method is working, but the operations fails with the error message:

Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type 'Aspose.Slides.Cloud.DTO.Export.ExportOptions'. Path: $.Options | LineNumber: 0 | BytePositionInLine: 37.

using the non async api it works.

There is really nothing special I do, see my code below.

val exportOptions = ImageExportOptions()
exportOptions.height = maxHeight
exportOptions.width = maxWidth

val operationId = api.startConvert(
    presentationBytes,
    ExportFormat.PNG,
    null,
    null,
    null,
    listOf(1),
    exportOptions,
)

while (true) {
    val status = api.getOperationStatus(operationId)
    val progress = status.progress?.let {
        it.stepIndex.toFloat() / it.stepCount.toFloat()
    } ?: 0F
    onProgress(progress)
    if (status.status == Operation.StatusEnum.FAILED) {
        // Log operation failed <-- This is where I read the error
    }
    if (status.status == Operation.StatusEnum.FINISHED) {
        // Fetch operation result
    }
    if (status.status == Operation.StatusEnum.CANCELED) {
        // Log operation cancelled
    }
    Thread.sleep(1000)
}

Do I do something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions