Welcome Guest, Not a member yet? Register   Sign In
How do i use Codeigniter or any existing library to generate pdf files using a blank pdf file
#11

[eluser]Paul Hernández[/eluser]
I have fixed the load library problem and I had to bump up the memory limit in the php.ini file, now I'm having other problems:

- Message: Use of undefined constant K_CELL_HEIGHT_RATIO - assumed 'K_CELL_HEIGHT_RATIO'

- Message: Cannot modify header information - headers already sent by (output started at /home/pauldj54/Desktop/pdftest/system/core/Exceptions.php:170)

I'll check your link and others forum post. Thanks for your time!
#12

[eluser]InsiteFX[/eluser]
PHP ROS PDF

Download

InsiteFX
#13

[eluser]Unknown[/eluser]
[quote author="outrage" date="1222336284"]Kinda goes something like this:

application
libraries
fpdf.php
fpdf_tpl.php
fpdi.php
fpdi_pdf_parser.php
pdf_context.php
pdf_parser.php
wrapper_functions.php


Controller
Code:
$this->load->library('fpdf');
define('FPDF_FONTPATH',$this->config->item('fonts_path'));
            
$this->load->library('fpdi');
            
// initiate FPDI  
$pdf =& new FPDI('P','mm','A4');
// add a page
$pdf->AddPage();
// set the sourcefile
$pdf->setSourceFile('resources/pdfs/your_pdf_template.pdf');
// import page 1
$tplIdx = $pdf->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100 mm
$pdf->useTemplate($tplIdx, 1, 1, 210);
// now write some text above the imported page
$pdf->SetFont('Arial');
$pdf->SetTextColor(0,0,0);

// Write something
$pdf->SetXY(88, 31);
$pdf->Write(0, "Hello world");

// Output
$pdf->Output('resources/pdfs/archives/'. $pdf_name, 'F');


Don't forget the fonts folder:
Add this to config.php

Code:
$config['fonts_path']= "resources/font/";

Works great for me, hope this helps.[/quote]


Outrage - Though your post was made many years ago, that was the key to me figuring out how to use CodeIgniter along with FPDF and FPDI. Thanks a bunch !! I am now able to customize PDF documents with CI and FPDI.

Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB