@@ -382,12 +382,31 @@ static PyObject *addAsyncListener(PyObject *obj, PyObject *args)
382382 return Py_BuildValue (" i" , 0 );
383383}
384384
385+ static PyObject *setParameters (PyObject *obj, PyObject *args)
386+ {
387+ DynamsoftDocumentScanner *self = (DynamsoftDocumentScanner *)obj;
388+
389+ const char *params;
390+ if (!PyArg_ParseTuple (args, " s" , ¶ms))
391+ {
392+ return NULL ;
393+ }
394+
395+ char errorMsgBuffer[512 ];
396+ int ret = DDN_InitRuntimeSettingsFromString (self->handler , params, errorMsgBuffer, 512 );
397+ printf (" Init runtime settings: %s\n " , errorMsgBuffer);
398+
399+ return Py_BuildValue (" i" , ret);
400+ }
401+
385402static PyMethodDef instance_methods[] = {
386403 {" decodeFile" , decodeFile, METH_VARARGS, NULL },
387404 {" decodeMat" , decodeMat, METH_VARARGS, NULL },
388405 {" addAsyncListener" , addAsyncListener, METH_VARARGS, NULL },
389406 {" decodeMatAsync" , decodeMatAsync, METH_VARARGS, NULL },
390- {NULL , NULL , 0 , NULL }};
407+ {" setParameters" , setParameters, METH_VARARGS, NULL },
408+ {NULL , NULL , 0 , NULL }
409+ };
391410
392411static PyTypeObject DynamsoftDocumentScannerType = {
393412 PyVarObject_HEAD_INIT (NULL , 0 ) " docscanner.DynamsoftDocumentScanner" , /* tp_name */
0 commit comments