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

[eluser]RaiNnTeaRs[/eluser]
Code:
$pdf = pdf_new();
    pdf_open_file($pdf,"http://192.168.1.188/ci2/report/report.pdf");
    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
#2

[eluser]RaiNnTeaRs[/eluser]
or does anyone know any idea to create a pd file using codeigniter ? Deadline is coming, help me plz T-T. Thanks.
#3

[eluser]Crimp[/eluser]
I use DomPDF as a CI plug-in. Information is on the CI wiki.
#4

[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).
#5

[eluser]RaiNnTeaRs[/eluser]
oe thx. Do I need some libraries to do so ? or can i use some plain Php Coding ? Thx
#6

[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.
#7

[eluser]RaiNnTeaRs[/eluser]
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)
#8

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

[eluser]RaiNnTeaRs[/eluser]
lol.. I change my lines it into
Code:
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.
#10

[eluser]RaiNnTeaRs[/eluser]
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