Advertisement
Guest User

endersending

a guest
Jan 14th, 2020
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1.  public function createPDF(){
  2.         $BaseFileName = $this->customerid."-".date("m-d-Y")."-".$this->invoiceid;
  3.         /* create the xsl-fo file */
  4.         $tmpDir =  $_SERVER["DOCUMENT_ROOT"] . "/../tmp";
  5.         $xmlDir = $_SERVER["DOCUMENT_ROOT"] . "/../invoicesXML";
  6.         $xmlFile = $xmlDir . "/SnowPlowing-Invoice.xsl";
  7.  
  8.       echo "gonna try to make a pdf";
  9.         /* Execute the fop command */
  10.         $command = 'export JAVA_HOME=/usr/local  && /usr/local/bin/fop -xml - -xsl '.$xmlFile.' -pdf '.$tmpDir.'/foo1.pdf '.$this->stringXML;
  11.         //echo $command;
  12.         $result = shell_exec($command);
  13.         echo $result;
  14.         //$cmd = 'set';
  15. //echo "<pre>".shell_exec($cmd)."</pre>";
  16.             }
  17.  
  18.  
  19. //fop example:
  20. //fop -xml - -xsl foo.xsl -pdf -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement