0
votes

I've faced a problem with FPDF. I am not an expert in FPDF so please could anyone help me?

I'm printing out some data on a PDF but it can't be opened because FPDF is printing my footer data above the content and above the version number.

So here is my PDF opened in Notepad:

BT /F1 6.00 Tf ET
q 0.561 0.561 0.561 rg BT 45.35 55.60 Td (.. here is my footer text .. ) Tj ET Q
%PDF-1.4 .. -> the pdf starts and has all my

data correctly

If I give him some addPage() or Close() it won't help. I've tried to select the Page but it also didn't help.

If I delete the text BT /F1.. manually the document is displayed correctly in the browser and in the Adobe reader. I don't know why FDPF is printing my footer above the content of the pdf?

1
I would suggest another pdf library like html2pdf instead of fpdf. It can slower than tcpdf but you improve the design process a lot! Another good alternative is a reporter like Jaspersoft Studio the hardest with this tool is the installation because you can design the pdf with a graphical interface that will save you minutes/hours in PDF design process.Art_Code
With your question and description there is no way to help you on the solution of your FPDF problem. There isn't code to debug and FPDF is a headache by itselfArt_Code

1 Answers

0
votes

You are calling the methods which paints the footer before adding at least a single page.

Only call methods which output content AFTER calling AddPage() at least one time.