Hello,
I'm facing a problem that I can't solve using the class fpdf within a snippet in evolution cms.
When I'm using the fpdf class in a standalone file "mypdf.php" called with a redirect
$modx->sendRedirect($modx->config['site_url'].'assets/snippets/mysnippet/mypdf.php');
with this basic code in the php file :
<?php
include('fpdf.php');
$PDF=new fpdf('P','mm','A4');
$PDF->AddPage();
$PDF->SetFont('Arial','',10);
$PDF->Write(12, "mytext");
$PDF->Output();
?>
it works fine, but I can't use TVs, $_SESSION etc.
So I tried to use a snippet with the same code inside, called from a doc with a blank template and the following settings :
Ressource type : web page
Content type : application/pdf
content output : inline element
ressource content : [!Pdf!]
and the snippet :
<?php
include($modx->config['base_path'].'assets/snippets/mysnippet/'.fpdf.php');
$PDF=new fpdf('P','mm','A4');
$PDF->AddPage();
$PDF->SetFont('Arial','',10);
$PDF->Write(12, "mytext");
$PDF->Output();
and I get nothing but a blank file (if I set the doc content type as text/html, I get a blank page)
I guess this has something to do with item 2 in
http://www.fpdf.org/?lang=en but i just can't find the solution within modx evolution.
I look at all posts that seemed to deal with this issue but did'nt find any solution.
Can anyone help ?
Thank's a lot !