<?phpclass dataface_actions_export_pdf { function handle(&$params){
$html = '<p>User</p>
<span> '.$user.' </span>
<p>Address</p>
<span> '.$address.' </span>
<p>Product</p>
<span> '.$product.' </span>
';//==============================================================//==============================================================//==============================================================include("mpdf/mpdf.php");$mpdf=new mPDF('c');$mpdf->SetDisplayMode('fullpage');// LOAD a stylesheet
$mpdf->WriteHTML($html);$mpdf->Output();exit; }}?>[export_pdf] label = To PDF description = "Export in PDF" category=record_export_actions mode=list url = "{$this->url('-action=export_pdf')}"--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/4f8aed4f-4abd-438c-8673-b07c3d49422f%40googlegroups.com.
Currently this module requires pdftk. There are pure php solutions for creating fdf files though. See this comment for an example
http://php.net/manual/en/ref.fdf.php#46624
--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/4764d7b1-3fe0-4ca6-bf18-53ae116d628b%40googlegroups.com.
<?php
/*************************** Generate PDFs filled with our data of choice using fpdf and fpdm only, without the need of pdftk, excellent for those on shared hosting. I create my PDF forms in OpenOffice WARNING - LibreOffice created forms doesn't seem to work, I don't know why yet. Generate your PDF form in OpenOffice writer and give them names like name, phone, email, etc. Go to File menu and select export to PDF, choose FDF type under Create PDF form and export it as PDF. Upload it to your template folder, mine is fdf_templates.pdf. Roberto-Cristian****************************/
// the path to the PDF template form, relative to this script's location$file = 'fdf_templates/template.pdf';
// Fill in text fields using an array (name_of_field => value we want filled with)$fields = array( 'serial' => 'EIT1', 'date' => '21.11.2014', 'customer' => 'COMPANY Y SPA', 'vatno' => '01555685', 'id' => '3056652', 'address' => 'My city, my state, my province', 'phone' => '099 865 2221', 'product' => 'LED Benq WHLD22 / WHL22DL / 36 months', 'invoice' => 'EIT 1234'
);
// Let's generate an FDF output and store it in a temporary file// this function takes in our PDF form as $pdf_file and the field values as $pdf_datafunction output_fdf ($pdf_file, $pdf_data) { $fdf = "%FDF-1.2\n%âãÏÓ\n"; $fdf .= "1 0 obj \n<< /FDF "; $fdf .= "<< /Fields [\n"; foreach ($pdf_data as $key => $val) $fdf .= "<< /T ($key) /V ($val) >> \n"; $fdf .= "]\n/F ($pdf_file) >>"; $fdf .= ">>\nendobj\ntrailer\n<<\n"; $fdf .= "/Root 1 0 R \n\n>>\n"; $fdf .= "%%EOF";
// we store the fdf output in a temporary file $tempfile = 'tempfdf.fdf'; file_put_contents($tempfile, $fdf); }
// Let's run the above function to generate our FDF file, it takes in our PDF form as $file and // fields > values as $fieldsoutput_fdf($file, $fields);
// Now, we call fpdm to create fill the PDF form template with our data from the temporary FDF file. //It should open in the browser as a filled PDFrequire('fpdf/fpdm.php');
$pdf = new FPDM('fdf_templates/template.pdf', 'tempfdf.fdf');$pdf->Merge();$pdf->Output();?>Warning: implode() [function.implode]: Invalid arguments passed in /home/www/xataface/fpdf/fpdm.php on line 1377
FPDF-Merge Error: getFilter cannot open stream of object because filter '' is not supported, sorry.
[export_pdf]--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/d89784f4-76e3-4199-816a-e4a08faf2d4a%40googlegroups.com.
<?phpclass dataface_actions_export_pdf { function handle(&$params){
/*************************** Generate PDFs filled with our data of choice using fpdf and fpdm only, without the need of pdftk, excellent for those on shared hosting. I create my PDF forms in OpenOffice WARNING - LibreOffice created forms doesn't seem to work, I don't know why yet. Generate your PDF form in OpenOffice writer and give them names like name, phone, email, etc. Go to File menu and select export to PDF, choose FDF type under Create PDF form and export it as PDF. Upload it to your template folder, mine is fdf_templates.pdf. [export_pdf] label = To PDF description = "Export in PDF" category=record_export_actions mode=list url = "{$this->url('-action=export_pdf')}"Warning: implode() [function.implode]: Invalid arguments passed in /home/www/xataface/fpdf/fpdm.php on line 1377
FPDF-Merge Error: getFilter cannot open stream of object because filter '' is not supported, sorry.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/41fef3a2-e10b-4ece-b14d-141cb9dbf5ac%40googlegroups.com.
/** *Retrieve the list of supported filters * *@note Uses $FPDM_FILTERS array built dynamically *@param String $sep a separator to merge filter names, default is '|' *@return String the suported filters **/ function getFilters($sep="|") { //--------------------- global $FPDM_FILTERS; return implode($sep,$FPDM_FILTERS); }To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/981d08f1-1def-4de0-a98a-33098c3de0b9%40googlegroups.com.