Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Community Voice - Generating PDF files using CodeIgniter
#11

[eluser]Khoa[/eluser]
Hi, I haven't checked out the lib yet, but from the examples that you gave in the article, it looks like we have to insert every piece of text into the PDF by ourself, from headers, spacing, tables... which can be very tedious, especially for dynamic contents.

So, can I ask does this pdf lib give us the option to convert the whole page on the fly into a pdf file? I know a pdf lib for PHP that can do this, but cant remember the name right now. What it can do is: I include a button, say, 'print' on the page, and when user clicks it, it will automatically convert the whole page into PDF document and download it to the browser. It will use the normal css or print CSS if we have one. It works just as you have the adobe PDF print driver installed on your computer (well, not that good, but close). Can we do that with this library?

Thanks.
Khoa
#12

[eluser]mrtopher[/eluser]
Khoa, nope... this library can't handle something like that. The R&OS;library is for those programmers who like to have access to ALL settings and such. I do know there are libraries that do what your referring to and I've even tried one or two. My issue with the ones I tries were they didn't handle text formatting (bold, italics, etc.) very well. Plus, R&OS;handles tables very well where other libraries take more work.

It all boils down to personal preference.
#13

[eluser]dede125a[/eluser]
Thanks for this intresting article, I'm nearly new to CI and before I used FPDF library who can use an existing PDF file to write on.
I have read (very fast) the R&OS;documentation and I haven't found any function who can permit the same thing...

So (my english is poor) I don't understand the doc or the feature is not présent ?

Thank by advance.
#14

[eluser]mrtopher[/eluser]
If I understand you correctly, you are looking for a library that can use an existing PDF file to create a report. Is that correct?

If this is your question the answer is no. The R&OS;class does not provide this kind of functionality.
#15

[eluser]dede125a[/eluser]
In fact I have a PDF document who have allready logo and text refinements and I put some informations on this document to generate a new document form DB and user input.
This is my syntax with FPDF :
Code:
$pdf = new fpdi();
$pagegab = $pdf->setSourceFile("gabarit_per2.pdf");
$pagetpl = $pdf->ImportPage(1);
$pdf->addPage();
$pdf->useTemplate($pagetpl,0,0,0);
// remplissage du pdf
$pdf->SetFont('Helvetica','',8);
$pdf->SetXY(85,51);
$pdf->Cell(80,8,utf8_decode("Saisie le ".date("d/m/Y")));
$pdf->SetFont('Helvetica','B',11);
$pdf->SetXY(120,47);
$pdf->Cell(50,8,$nabo);
$pdf->SetFillColor(0,0,0);
if ($_POST['pervac']!=""){$pdf->Rect(26.5,71.5,3,3,'F');}
if ($_POST['perval']!=""){$pdf->Rect(77.5,71.5,3,3,'F');}
if ($_POST['peroedi']!=""){$pdf->Rect(129,71.5,3,3,'F');}
...
// generation du pdf
$fichier = "bulletins/".$nabo.".pdf";
$pdf->Output($fichier,"F");
$pdf->closeParsers();

After reading carfully the doc of R&OS;he seems no capable to do that. Sad

So, I continue to use FPDF, thanks anyway Wink
#16

[eluser]Unknown[/eluser]
Hi, thanx for this great article.

I'm just wondering if anyone knows if it is possible to have utf-8 support in R&OS;?

I tried to figure it out, but it still doesn't work for me Sad
#17

[eluser]Zola[/eluser]
Hi guys, am also new in this framework and doing in CI. My problem is generating information the database to PDF. I've download that domPDF library that many of you suggested but am having an error:
Fatal error: Call to undefined method DOMText::getAttribute() in system\plugins\dompdf\include\cellmap.cls.php

Could anyone help me with this,

Regards
#18

[eluser]Zola[/eluser]
Hi, am also using the R&OS;pdf class in PHP 5. This is my first project with CI and am finding it difficult to get the database results and print them in a pdf. I used the examples in the class, i tried substituting the table with a query that generates the result.

I've tested the query and it is working fine, but when i put it in the class it shows a blank pdf, can anyone help on this.

Regards,

Zola.
#19

[eluser]mrtopher[/eluser]
@zola - Sorry about the delayed response. I was subscribed to this thread but somehow I am no longer receiving e-mail updates. Anyway, I'm not familar with the domPDF library so I don't think I'm going to be of much help there.

In reference to your second question though, the catch to using R&OS;with database results is that you can't just send the results to it and expect it to sort out the rest. You will actually have to loop through the results and put them in an associative array like this:

Code:
$results = array('column_title' => 'value');

So if you loop through your query results and then pass the resulting array to R&OS;you should be good to go.
#20

[eluser]mrtopher[/eluser]
Quote:In fact I have a PDF document who have allready logo and text refinements and I put some informations on this document to generate a new document form DB and user input.

You can include images in a PDF generated with this library, I would link to the documentation but it's not web based. If you look in the PDF on their website the function in on page 11. I have done this before with some sketchy results. The R&OS;library is certainly not the ultimate solution, but you can usually get it to work.

Quote:I’m just wondering if anyone knows if it is possible to have utf-8 support in R&OS;?

I don't know the answer to this question. I did some quick searching through their documentation PDF and it didn't return any results so my guess is no. It's been a while since this library was updated, so my guess is that it doesn't support utf-8.




Theme © iAndrew 2016 - Forum software by © MyBB