| Server IP : 87.98.154.146 / Your IP : 216.73.216.101 Web Server : Apache System : Linux webm005.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : bsiadvisil ( 110003) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/bsiadvisil/www/components/com_rsform/views/submissions/ |
Upload File : |
<?php
/**
* @package RSForm! Pro
* @copyright (C) 2007-2014 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
defined('_JEXEC') or die('Restricted access');
class RsformViewSubmissions extends JViewLegacy
{
public function display($tpl = null)
{
$this->app = JFactory::getApplication();
$this->params = $this->app->getParams('com_rsform');
$this->template = $this->get('template');
parent::display($tpl);
// Build the PDF Document string from the document buffer
$contents = ob_get_contents();
ob_end_clean();
$filename = 'export.pdf';
// Allow plugins to use their own PDF library
$this->app->triggerEvent('rsfp_onPDFView', array($contents, $filename));
/*
* Setup external configuration options
*/
define('K_TCPDF_EXTERNAL_CONFIG', true);
/*
* Path options
*/
// Installation path
define("K_PATH_MAIN", JPATH_LIBRARIES . "/tcpdf");
// URL path
define("K_PATH_URL", JPATH_BASE);
// Fonts path
define("K_PATH_FONTS", K_PATH_MAIN . '/fonts/');
// Cache directory path
define("K_PATH_CACHE", K_PATH_MAIN . "/cache");
// Cache URL path
define("K_PATH_URL_CACHE", K_PATH_URL . "/cache");
// Images path
define("K_PATH_IMAGES", K_PATH_MAIN . "/images");
// Blank image path
define("K_BLANK_IMAGE", K_PATH_IMAGES . "/_blank.png");
/*
* Format options
*/
// Cell height ratio
define("K_CELL_HEIGHT_RATIO", 1.25);
// Magnification scale for titles
define("K_TITLE_MAGNIFICATION", 1.3);
// Reduction scale for small font
define("K_SMALL_RATIO", 2 / 3);
// Magnication scale for head
define("HEAD_MAGNIFICATION", 1.1);
/*
* Create the pdf document
*/
jimport('tcpdf.tcpdf');
$pdf = new TCPDF();
$pdf->SetMargins(15, 27, 15);
$pdf->SetAutoPageBreak(true, 25);
$pdf->SetHeaderMargin(5);
$pdf->SetFooterMargin(10);
$pdf->setImageScale(4);
$document = JFactory::getDocument();
// Set PDF Metadata
$pdf->SetCreator($document->getGenerator());
$pdf->SetTitle($document->getTitle());
$pdf->SetSubject($document->getDescription());
$pdf->SetKeywords($document->getMetaData('keywords'));
// Set PDF Header data
$pdf->setHeaderData('', 0, $document->getTitle(), null);
// Set RTL
$lang = JFactory::getLanguage();
$pdf->setRTL($lang->isRTL());
// Set Font
$font = 'freesans';
$pdf->setHeaderFont(array($font, '', 10));
$pdf->setFooterFont(array($font, '', 8));
// Initialize PDF Document
if (is_callable(array($pdf, 'AliasNbPages'))) {
$pdf->AliasNbPages();
}
$pdf->AddPage();
$pdf->WriteHTML($contents, true);
$data = $pdf->Output('', 'S');
// Build the PDF Document string from the document buffer
header('Content-Type: application/pdf; charset=utf-8');
header('Content-disposition: inline; filename="' . $filename . '"', true);
echo $data;
$this->app->close();
}
}