Esempio n. 1
0
 /**
  * Output the result of the canvas
  *
  * @param array $param Parameter array
  * @abstract
  */
 function save($param = false)
 {
     parent::save($param);
     pdf_end_page($this->_pdf);
     pdf_close($this->_pdf);
     $buf = pdf_get_buffer($this->_pdf);
     $len = strlen($buf);
     $fp = @fopen($param['filename'], 'wb');
     if ($fp) {
         fwrite($fp, $buf, strlen($buf));
         fclose($fp);
     }
     pdf_delete($this->_pdf);
 }
Esempio n. 2
0
 /**
  * Output the result of the canvas
  *
  * @param array $param Parameter array
  */
 function save($param = false)
 {
     parent::save($param);
     $output = '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n" . '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"' . "\n\t" . ' "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">' . "\n" . '<svg width="' . $this->_width . '" height="' . $this->_height . '" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">' . "\n" . ($this->_defs ? '    <defs>' . "\n" . $this->_defs . '    </defs>' . "\n" : '') . $this->_elements . '</svg>';
     $file = fopen($param['filename'], 'w+');
     fwrite($file, $output);
     fclose($file);
 }
Esempio n. 3
0
 /**
  * Output the result of the canvas
  *
  * @param array $param Parameter array
  */
 function save($param = false)
 {
     parent::save($param);
     $output = $this->getData($param);
     $file = fopen($param['filename'], 'w+');
     fwrite($file, $output);
     fclose($file);
 }
Esempio n. 4
0
 /**
  * Save the result of the canvas to a file
  *
  * Parameter array:
  * 'filename': string The file to output to
  * @param array $params Parameter array, the contents and meaning depends on the actual Canvas
  * @abstract
  */
 function save($params = false)
 {
     parent::save($params);
     $file = fopen($param['filename'], 'w+');
     fwrite($file, $this->toHtml($params));
     fclose($file);
 }
Esempio n. 5
0
File: SWF.php Progetto: roojs/pear
 /**
  * Save the SWF to a file
  *
  * @param array $param Parameter array
  *              array('filename'    => 'canvas.swf',
  *                    'compression' => 0)
  *
  *              The compression level can be a value between 0 and 9,
  *              defining the SWF compression similar to gzip compression.
  *              This parameter is only available as of Flash MX (6).
  *
  * @return void
  */
 function save($param = false)
 {
     if (!isset($param['compression'])) {
         $param['compression'] = 0;
     }
     parent::save($param);
     $this->_canvas->save($param['filename'], $param['compression']);
 }