private function getsourcepdf(array $data)
 {
     ini_set('memory_limit', '1024M');
     if (!is_dir(dirname(__DIR__) . '/tmp')) {
         mkdir(dirname(__DIR__) . '/tmp');
     }
     chmod(dirname(__DIR__) . '/tmp', 0777);
     $params = ['error' => null, 'errorinfo' => ''];
     $tmpFileName = 'gantt_export_' . Helper::randomString() . '.pdf';
     $tmpFilePath = \OC::$SERVERROOT . \OC_App::getAppWebPath('owncollab_chart') . '/tmp/' . $tmpFileName;
     $encodeData = 'data=' . urlencode($data['data']) . '&type=pdf';
     ob_start();
     system('curl --request POST "https://export.dhtmlx.com/gantt" --data "' . $encodeData . '"');
     $result = ob_get_clean();
     //$params['$encodeData'] = $encodeData;
     //$params['$tmpFilePath'] = print_r($result, true);
     //$params['result strlen'] = strlen($result);
     $print_portrait = isset($data['printconf']['orientation']) && $data['printconf']['orientation'] == 'P';
     $print_paper_size = isset($data['printconf']['paper_size']) ? $data['printconf']['paper_size'] : 'A4';
     $print_notes = isset($data['pagenotes']) ? $data['pagenotes'] : false;
     if ($result) {
         if ($is_save = file_put_contents($tmpFilePath, $result)) {
             $downloadPath = $this->explodePDF($tmpFilePath, $print_portrait, $print_paper_size, $print_notes);
             if ($downloadPath) {
                 $params['download'] = $downloadPath;
             } else {
                 $params['errorinfo'] = 'Error: download path exist';
             }
         } else {
             $params['errorinfo'] = 'Saved PDF file fail. Temp path: ' . $tmpFilePath;
         }
     } else {
         $params['errorinfo'] = 'Request to export.dhtmlx.com is failed. Or response is empty';
     }
     if (is_array($params)) {
         return new DataResponse($params);
     }
 }