Welcome Guest, Not a member yet? Register   Sign In
FPDF
#1

Hello together,

I implemented the FPDF Library in my CI4 project. It is in app\Libraries\fpdf.php + font folder.

I added the following to autoload:
Code:
$classmap = [
    'FPDF' => APPPATH .'Libraries/fpdf.php'
];

In my Controller:
PHP Code:
use FPDF;

$pdf = new FPDF();
        $pdf->AddPage();
        $pdf->SetFont('Arial','B',16);
        $pdf->Cell(40,10,'Hello World!');
        $pdf->Output(); 

If I open the page there is just the following output:

%PDF-1.3 3 0 obj <> endobj 4 0 obj <> stream x�3R��2�35W(�r Q�w3T04�30PISp  �Z*�[����(hx����+���(j*�d��7W endstream endobj 1 0 obj <> endobj 5 0 obj <> stream x�]R�n�0��>��L�%�DI�8���~�%E*r�ﻻvҪHX�gvVk?/���Ῑ��`]�[�x5 �3\z��P�}����PO���j�Jݍ^���x6/f�����������|���4}�z�����}���@�,ۖ-��˺E�u�^�,���<� �Z_�K� IQ����Yd����C�K�_�%q�8>�!J"V!2&bGģ%r"H��D��\}2EL1n��h�j���e��"a*H����:��d��9c���[�X1~��"�3�g��Ñ�;O��> endobj 2 0 obj << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] /Font << /F1 6 0 R >> /XObject << >> >> endobj 7 0 obj << /Producer (FPDF 1.82) /CreationDate (D:20200512140733) >> endobj 8 0 obj << /Type /Catalog /Pages 1 0 R >> endobj xref 0 9 0000000000 65535 f 0000000228 00000 n 0000000867 00000 n 0000000009 00000 n 0000000087 00000 n 0000000315 00000 n 0000000749 00000 n 0000000971 00000 n 0000001047 00000 n trailer << /Size 9 /Root 8 0 R /Info 7 0 R >> startxref 1096 %%EOF

...If I use the same files / library in a standalone .php file it creates the PDF Undecided
[url=https://forum.codeigniter.com/javascript:void(0)][/url]

Does anyone has an idea how to get fpdf running?

best regards,
Niklas
Reply


Messages In This Thread
FPDF - by niklas - 05-12-2020, 05:20 AM
RE: FPDF - by vitnibel - 05-12-2020, 09:26 AM
RE: FPDF - by niklas - 05-14-2020, 12:32 AM
RE: FPDF - by pws - 09-10-2020, 02:45 AM
RE: FPDF - by vitnibel - 09-11-2020, 08:10 PM
RE: FPDF - by stepgr - 09-19-2020, 02:33 AM
RE: FPDF - by pws - 09-11-2020, 10:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB