Welcome Guest, Not a member yet? Register   Sign In
trying to creATE A PDF FILE USING PHP and CodeIgniter.

$pdf = pdf_new();
    pdf_set_info($pdf, "Author", "Sales-admin");
    pdf_set_info($pdf, "Title", "Confirmation report");
    pdf_set_info($pdf, "Creator", "www.a.com");
    pdf_set_info($pdf, "Subject", "Order Confirmation");
    pdf_begin_page($pdf, 595, 842);

My error message:
Fatal error: Uncaught exception 'PDFlibException' with message 'Function must not be called in 'object' scope' in C:\xampp\htdocs\ci2\system\application\controllers\dojang.php:1019 Stack trace: #0 C:\xampp\htdocs\ci2\system\application\controllers\dojang.php(1019): pdf_begin_page() #1 C:\xampp\htdocs\ci2\system\codeigniter\CodeIgniter.php(224): Dojang->report(Resource id #48, 595, 842) #2 C:\xampp\htdocs\ci2\index.php(115): require_once('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\ci2\system\application\controllers\dojang.php on line 1019

or does anyone know any idea to create a pd file using codeigniter ? Deadline is coming, help me plz T-T. Thanks.

I use DomPDF as a CI plug-in. Information is on the CI wiki.

[eluser]Michael Wales[/eluser]
You can also check-out the source for BambooInvoice - a great example of how to make PDFs (if I remember correctly it uses views to do so).

oe thx. Do I need some libraries to do so ? or can i use some plain Php Coding ? Thx

[eluser]Derek Allard[/eluser]
There are extensions built into some PHP installs, but in general you'll need a library. Did you look at the sources offered above, I think you'll find they're a good direction for you.

Wow... Mr.Derek Allard,my favorite CodeIgniter's author ^^.Thx for replying sir. finally I;ve managed to installed the pdflib, but i got some major problems : Couldn't open font file '/home/rnbtaekw/public_html/font/' ( in pdf_findfont command)

[eluser]Derek Allard[/eluser]
What generated that RaiNnTeaRs (that's surprisingly difficult to type). Was it one of thee resources listed?

lol.. I change my lines it into
pdf_set_parameter($pdf, 'FontOutline', 'Arial=/home/rnbtaekw/public_html/Font/arial.ttf');
$arial = pdf_findfont($pdf, "Arial", "host", 1);
and it works well, what troubles me now is that
pdf invert the Y coordinates ( bottom pages = (y=0) ),
and also I cant overwrite it..

I want to create report.pdf that can be overwritten ( changes every times I create new report ). Consist of some pages (if it has alot of records).

How can I overwrite my pdf files, and create new pages with it. Thanks.

Finally I delete my PDF files using FTP, and create a new pdf files. But the problem now is I dunno how to draw a fill rectangle, I've read the PDF_ PHP Manual , buat none was satisfactory. Can anyone help.. ^^

Theme © iAndrew 2016 - Forum software by © MyBB