mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 12:03:14 +00:00
V 3.5 RC 1
This commit is contained in:
34
lib/classes/binaryAdapter/document/toFlexpaperSwf.class.php
Normal file
34
lib/classes/binaryAdapter/document/toFlexpaperSwf.class.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2010 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package binaryAdapter
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class binaryAdapter_document_toFlexpaperSwf extends binaryAdapter_adapterAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $processors = array(
|
||||
'binaryAdapter_document_toFlexpaperSwf_pdf2swf'
|
||||
);
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'Binary adapter document to flexpaper swf';
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2010 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package binaryAdapter
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class binaryAdapter_document_toFlexpaperSwf_pdf2swf extends binaryAdapter_processorAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = array();
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $binary_name = 'GV_pdf2swf';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param system_file $origine
|
||||
* @param string $dest
|
||||
* @return binaryAdapter_document_toFlexpaperSwf_pdf2swf
|
||||
*/
|
||||
protected function process(system_file $origine, $dest)
|
||||
{
|
||||
$system = system_server::get_platform();
|
||||
|
||||
if ($system == 'WINDOWS')
|
||||
{
|
||||
$cmd = sprintf('%s %s %s -s poly2bitmap -T 9 -f'
|
||||
, $this->binary
|
||||
, $this->escapeshellargs($origine->getPathname())
|
||||
, $this->escapeshellargs($dest)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$cmd = sprintf('%s %s %s -s poly2bitmap -Q 300 -T 9 -f'
|
||||
, $this->binary
|
||||
, $this->escapeshellargs($origine->getPathname())
|
||||
, $this->escapeshellargs($dest)
|
||||
);
|
||||
}
|
||||
|
||||
$this->shell_cmd($cmd);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
34
lib/classes/binaryAdapter/document/toPDF.class.php
Normal file
34
lib/classes/binaryAdapter/document/toPDF.class.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2010 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package binaryAdapter
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class binaryAdapter_document_toPDF extends binaryAdapter_adapterAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $processors = array(
|
||||
'binaryAdapter_document_toPDF_unoconv'
|
||||
);
|
||||
|
||||
public function get_name()
|
||||
{
|
||||
return 'Binary adapter document to PDF';
|
||||
}
|
||||
|
||||
}
|
55
lib/classes/binaryAdapter/document/toPDF/unoconv.class.php
Normal file
55
lib/classes/binaryAdapter/document/toPDF/unoconv.class.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2010 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package binaryAdapter
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class binaryAdapter_document_toPDF_unoconv extends binaryAdapter_processorAbstract
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $options = array();
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $binary_name = 'GV_unoconv';
|
||||
|
||||
/**
|
||||
*
|
||||
* @param system_file $origine
|
||||
* @param string $dest
|
||||
* @return binaryAdapter_document_toPDF_unoconv
|
||||
*/
|
||||
protected function process(system_file $origine, $dest)
|
||||
{
|
||||
$tmp_file = $this->registry->get('GV_RootPath')
|
||||
. 'tmp/tmp_doc_' . time()
|
||||
. mt_rand(10000, 99999) . '.pdf';
|
||||
|
||||
$cmd = sprintf('%s --format=pdf --stdout %s > %s'
|
||||
, $this->binary
|
||||
, $this->escapeshellargs($origine->getPathname())
|
||||
, $this->escapeshellargs($dest)
|
||||
);
|
||||
|
||||
$this->shell_cmd($cmd);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user