Пример #1
0
         copy($outputFile, $pathOutput . $sFilename . '.pdf');
         //die;
         break;
     case 'ACROFORM':
         //creating the xml with the application data;
         $xmlData = "<dynaform>\n";
         foreach ($Fields['APP_DATA'] as $key => $val) {
             $xmlData .= "  <{$key}>{$val}</{$key}>\n";
         }
         $xmlData .= "</dynaform>\n";
         //$iSize = file_put_contents ( $javaOutput .  'addressBook.xml' , $xmlData );
         G::LoadClass('javaBridgePM');
         $JBPM = new JavaBridgePM();
         $JBPM->checkJavaExtension();
         $util = new Java("com.processmaker.util.pmutils");
         $util->setInputPath($javaInput);
         $util->setOutputPath($javaOutput);
         copy(PATH_DYNAFORM . $aOD['PRO_UID'] . PATH_SEP . $aOD['OUT_DOC_UID'] . '.pdf', $javaInput . $aOD['OUT_DOC_UID'] . '.pdf');
         $outputFile = $javaOutput . $sFilename . '.pdf';
         print $util->writeVarsToAcroFields($aOD['OUT_DOC_UID'] . '.pdf', $xmlData);
         copy($javaOutput . $aOD['OUT_DOC_UID'] . '.pdf', $pathOutput . $sFilename . '.pdf');
         break;
     default:
         throw new Exception('invalid output document');
 }
 //Execute after triggers - Start
 $Fields['APP_DATA'] = $oCase->ExecuteTriggers($_SESSION['TASK'], 'OUTPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA']);
 $Fields['DEL_INDEX'] = $_SESSION['INDEX'];
 $Fields['TAS_UID'] = $_SESSION['TASK'];
 //Execute after triggers - End
 //Save data - Start