//Check is user choose file GUID if ($fileId != "") { //Get entered by user file GUID $fileGuId = $fileId; } F3::set('fileId', $fileGuId); //Create job info object $jobInfo = new JobInfo(); $jobInfo->actions = "8193"; $jobInfo->out_formats = array('doc'); //Create new job $createJob = $asyncApi->CreateJob($clientID, $jobInfo); if ($createJob->status == "Ok") { try { //Add document to job $addJobDocument = $asyncApi->AddJobDocument($clientID, $createJob->result->job_id, $fileGuId, false); if ($addJobDocument->status != "Ok") { throw new Exception($addJobDocument->error_message); } } catch (Exception $e) { $error = 'ERROR: ' . $e->getMessage() . "\n"; F3::set('error', $error); } try { //Change job status $jobInfo->status = 0; //Update job with new status $updateJob = $asyncApi->UpdateJob($clientID, $createJob->result->job_id, $jobInfo); if ($updateJob->status == "Ok") { try { //Delay for server proccesing
} try { //Create job info object $jobInfo = new JobInfo(); $jobInfo->actions = "convert, combine"; $jobInfo->out_formats = array("pdf"); $jobInfo->status = -1; $jobInfo->email_results = true; $jobInfo->name = "test" . rand(0, 500); //Create new job $createJob = $asyncApi->CreateJob($clientID, $jobInfo); if ($createJob->status == "Ok") { try { //Add uploaded documents to job for ($n = 0; $n < count($guidArray); $n++) { $addJobDocument = $asyncApi->AddJobDocument($clientID, $createJob->result->job_id, $guidArray[$n], false); if ($addJobDocument->status != "Ok") { throw new Exception($addJobDocument->error_message); } } } catch (Exception $e) { $error = 'ERROR: ' . $e->getMessage() . "\n"; F3::set('error', $error); } try { //Change job status $jobInfo->status = 0; //Update job with new status $updateJob = $asyncApi->UpdateJob($clientID, $createJob->result->job_id, $jobInfo); if ($updateJob->status == "Ok") { try {