print pdf and save streetview img
This commit is contained in:
parent
b03b403ea5
commit
38402789f7
@ -128,15 +128,22 @@ class PrintController extends Zend_Controller_Action
|
||||
exit;
|
||||
}
|
||||
$fichier = str_replace('.pdf', '', $fichier);
|
||||
|
||||
|
||||
/* $xml = $doc->saveXML();
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$outfile = $c->profil->path->shared.'/temp/pages/p'.$user->getIdClient().'-'.$file;
|
||||
*/
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/temp/pages/'.$fichier.'.html';
|
||||
if (!file_exists($file))
|
||||
{
|
||||
echo 'Fichier introuvable';
|
||||
echo $file;
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
$pdf = new Scores_Wkhtml_Pdf();
|
||||
$pdf->setOptions('footer-right', 'Page [page] sur [toPage]');
|
||||
$pdf->setOptions('header-right', date('d/m/Y H:i:s'));
|
||||
|
@ -46,7 +46,7 @@ class File_StreetviewController extends Zend_Controller_Action
|
||||
$pos = strpos($base64, $removePart);
|
||||
$data = substr($base64, $pos + strlen($removePart));
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/persist/streetview/'.$name;
|
||||
$file = $c->profil->path->shared.'/temp/pages/file/streetview/img/'.$name;
|
||||
$result = file_put_contents($file, base64_decode($data));
|
||||
if ($result === false) {
|
||||
echo "Error";
|
||||
|
@ -3,9 +3,9 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
public function dispatchLoopShutdown()
|
||||
{
|
||||
Zend_Registry::get('firebug')->info('PLUGIN PDF - START');
|
||||
Zend_Registry::get('firebug')->info('PLUGIN PDF - START');
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ($layout->isEnabled()) {
|
||||
$controller = $this->_request->getControllerName();
|
||||
$action = $this->_request->getActionName();
|
||||
@ -14,7 +14,7 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
||||
if ($page->exportable('pdf')){
|
||||
$layout = $this->_response->getBody();
|
||||
$filename = $page->filename('pdf', $this->_request->getParams());
|
||||
$content = preg_replace('@<link href="/@si','<link href="./',$layout);
|
||||
$content = preg_replace('@<link href="/@si','<link href="../../../../extranet/public/',$layout);
|
||||
$content = preg_replace('@src="/@si','src="./',$content);
|
||||
$c = Zend_Registry::get('config');
|
||||
file_put_contents($c->profil->path->shared.'/temp/pages/'.$filename.'.html', $content);
|
||||
@ -23,4 +23,5 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
||||
|
||||
Zend_Registry::get('firebug')->info('PLUGIN PDF - END');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user