Welcome Guest, Not a member yet? Register   Sign In
FPDI and CodeIgniter, cannot read PDFs
#1

[eluser]tjstalcup[/eluser]
I have made my PDFs readable, 444, and I have tried putting the PDFs outside of the root directory and using:
Code:
$pdf->SetSourceFile(base_url()."businesscard.pdf");

this bit of code just keeps the browser spinning, not loading anything

If I put the PDF in the same directory as the script:

Code:
$pdf->SetSourceFile("businesscard.pdf");

it says FPDF error: Cannot open businesscard.pdf !

Now, if I take out that line, it generates the PDF fine. I have been using FPDI/FPDF for 2 years before using CI and never had this issue. Is there a configuration setting inside of CI that would allow me to import PDFs?

Thanks.
#2

[eluser]pistolPete[/eluser]
[quote author="tjstalcup" date="1250117241"]I have made my PDFs readable, 444, and I have tried putting the PDFs outside of the root directory and using:
Code:
$pdf->SetSourceFile(base_url()."businesscard.pdf");
[/quote]

Since you try to access the file via the full url, is allow_url_fopen set to true in your php.ini?
#3

[eluser]tjstalcup[/eluser]
[quote author="pistolPete" date="1250119656"][quote author="tjstalcup" date="1250117241"]I have made my PDFs readable, 444, and I have tried putting the PDFs outside of the root directory and using:
Code:
$pdf->SetSourceFile(base_url()."businesscard.pdf");
[/quote]

Since you try to access the file via the full url, is allow_url_fopen set to true in your php.ini?[/quote]

allow_url_fopen On On

that's what's in my phpinfo();
#4

[eluser]derekmichaeljohnson[/eluser]
[quote author="tjstalcup" date="1250117241"]
Code:
$pdf->SetSourceFile(base_url()."businesscard.pdf");
[/quote]
Rather than using base_url(), I would define the real path (i.e. /opt/lampp/...).

Incidentally, I'm trying to integrate FPDI myself. I've got FPDF working like a charm, but I'm running into issues with FPDI. Care to post a quick outline of how you installed FPDI?
#5

[eluser]Paul Hernández[/eluser]
I have similar problems, I installed fpdf and tcpdf, both work well, but I need fpdi to open pdf templates, I received an error when I try to load the class. The error fired in the Loader.php file, line 920 (CI2)

Code:
// Is the class name valid?
        if ( ! class_exists($name))
        {
            log_message('error', "Non-existent class: ".$name);
            show_error("Non-existent class: ".$class);
        }

It's suppose to be a class name problem. I was reading the custom class naming convention in the user guide and all of the classes (fpdf, tcpdf and fpdi) do not meet the naming conventions, but only fpdi fail.

Any ideas

Regards




Theme © iAndrew 2016 - Forum software by © MyBB