Como Poner La Firma En Un Pdf

I am getting Runtime error while downloading file using Kotlin in android here in this code i am using thread and if i don't use it then app is crashing and I don't know why i am getting this error well I am new at Kotlin so sorry for any trouble, and also I am trying to make extension here for mit app inventor and i am new at this also ....