I have created a PDF with the PHP form plugin and I know where it's stored,
but when I try to send it through the email plugin ("attachment eval. function"),
I don't receive it — only the content of the email per se (what I have written on "message text":
). It may be caused by the email plugin, because it sends the email right away and PDF it's not created yet, but I'm a newbie speculating, so... (I don't know what's really happening .)
Thanks in advance.
PD: PDF only gives numeric characters on placeholders, like it's using the raw version ({tablename___elementname_raw}) of it automatically, and I can't change it.
PD2: as always, I'm gonna attach the PHP I've used, in case you need it.
PHP:
$pdf->Output($_SERVER['DOCUMENT_ROOT'] . '{tablename___elementname}.pdf', 'F');
PHP:
$file[] = 'http://mywebsite.com/{tablename___elementname}.pdf';
return $file;
HTML:
<p style="text-align: center;"><span style="font-size: 18pt;"><strong>Title</strong></span></p>
<p style="text-align: center;"><span style="font-size: 18pt;"><strong>Subtitle</strong></span></p>
<p style="text-align: right;">{mysql_date}</p>
<p> </p>
<p>Body text</p>
<p><span style="text-decoration: underline;"><strong>Placeholder:</strong></span>: {tablename___elementname}</p>
<p> </p>
Thanks in advance.
PD: PDF only gives numeric characters on placeholders, like it's using the raw version ({tablename___elementname_raw}) of it automatically, and I can't change it.
PD2: as always, I'm gonna attach the PHP I've used, in case you need it.
PHP:
require_once('libraries/tcpdf/tcpdf.php');
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetAuthor('Author');
$pdf->SetTitle('Title with placeholder {tablename___elementname}');
$pdf->SetSubject('Subject');
$pdf->SetHeaderData(PDF_HEADER_TITLE.' Header Title', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
$pdf->setFooterData(array(0,64,0), array(0,64,128));
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setFontSubsetting(true);
$pdf->SetFont('helvetica', '', 12, '', true);
$pdf->AddPage();
$html = <<<EOD
<p style="text-align: center;"><span style="font-size: 18pt;"><strong>Body text</strong></span></p>
<p><span style="text-decoration: underline;"><strong>Placeholder</strong></span>: {tablename___elementname}</p>
<p><span style="text-decoration: underline;"><strong>Apellidos</strong></span>: {autorizacion_dispositivo___apellidos}</p>
<p><span style="text-decoration: underline;"><strong>Dispositivos</strong></span>: {autorizacion_dispositivo_7_repeat___dispositivo}</p>
<p><span style="text-decoration: underline;"><strong>Signature</strong></span>: <img src="http://www.mywebsite.com/index.php?option=com_fabrik\&task=plugin.pluginAjax\&plugin=digsig\&method=ajax_signature_to_image\&format=raw\&element_id=35\&formid=5\&rowid={elementname___tablename}\&repeatcount=0" alt="" width="400" height="250" /></p>
<p> </p>
EOD;
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
$pdf->Output($_SERVER['DOCUMENT_ROOT'] . '{tablename___elementname}.pdf', 'F');
Last edited: