예제 #1
0
파일: memory.php 프로젝트: promoso/HVAC
<?php

$ps = ps_new();
if (!ps_open_file($ps, "-")) {
    print "Cannot open PostScript file\n";
    exit;
}
ps_set_info($ps, "Creator", "draw.php");
ps_set_info($ps, "Author", "Uwe Steinmann");
ps_set_info($ps, "Title", "Creating document in memory");
ps_begin_page($ps, 596, 842);
ps_end_page($ps);
ps_close($ps);
echo ps_get_buffer($ps);
ps_delete($ps);
예제 #2
0
 function writeToStream($stream)
 {
     ps_end_page($this->ps);
     ps_close($this->ps);
     $buf = ps_get_buffer($this->ps);
     fwrite($stream, $buf);
     ps_delete($this->ps);
 }
예제 #3
0
파일: PS.php 프로젝트: ronaldoof/geocloud2
 /**
  * Output the result of the canvas
  *
  * @param array $param Parameter array
  * @abstract
  */
 function save($param = false)
 {
     parent::save($param);
     ps_end_page($this->_ps);
     ps_close($this->_ps);
     if ($param['filename'] == "") {
         $buf = ps_get_buffer($this->_ps);
         $len = strlen($buf);
         $fp = @fopen($param['filename'], 'wb');
         if ($fp) {
             fwrite($fp, $buf, strlen($buf));
             fclose($fp);
         }
     }
     ps_delete($this->_ps);
 }