Я пытался сгенерировать пример файла pdf в sugarcrm, используя пример кода в документации по этой ссылке здесь
, и попытался получить к нему доступ по этому URL:
http://sugarpro8.local.com/index.php?module=Meetings&action=sugarpdf&sugarpdf=clientpdf
вот исходный код:
<?php
require_once('include/Sugarpdf/Sugarpdf.php');
class clientpdf extends Sugarpdf
{
/**
* Override
*/
function process(){
$this->preDisplay();
$this->display();
$this->buildFileName();
}
/**
* Custom header
*/
public function Header()
{
$this->SetFont(PDF_FONT_NAME_MAIN, 'B', 16);
$this->MultiCell(0, 0, 'TCPDF Header',0,'C');
$this->drawLine();
}
/**
* Custom header
*/
public function Footer()
{
$this->SetFont(PDF_FONT_NAME_MAIN, '', 8);
$this->MultiCell(0,0,'TCPDF Footer', 0, 'C');
}
/**
* Predisplay content
*/
function preDisplay()
{
//Adds a predisplay page
$this->AddPage();
$this->SetFont(PDF_FONT_NAME_MAIN,'',PDF_FONT_SIZE_MAIN);
$this->Ln();
$this->MultiCell(0,0,'Predisplay Content',0,'C');
}
/**
* Main content
*/
function display()
{
//add a display page
$this->AddPage();
$this->SetFont(PDF_FONT_NAME_MAIN,'',PDF_FONT_SIZE_MAIN);
$this->Ln();
$this->MultiCell(0,0,'Display Content',0,'C');
}
/**
* Build filename
*/
function buildFileName()
{
$this->fileName = 'example.pdf';
}
/**
* This method draw an horizontal line with a specific style.
*/
protected function drawLine()
{
$this->SetLineStyle(array('width' => 0.85 / $this->getScaleFactor(), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(220, 220, 220)));
$this->MultiCell(0, 0, '', 'T', 0, 'C');
}
}
вот скриншот сообщения об ошибке:
также мой пользовательский файл PDF находится по пути /custom/modules/Meetings/sugarpdf/sugarpdf.clientpdf.php
что я здесь не так сделал?надеюсь, что некоторые гениальные программисты знают ответ.