TYPO3控制器中的FPDF CoreFonts问题

I'm running a script which generates a PDF via FPDF. In "standalone" it works like a charm, but when I copy the same script inside a T3 custom action, it throws an error.

in_array() expects parameter 2 to be array, null given in ...bla/fpdf.php line 527

fpdf.php line 527:

if(in_array($family,$this->CoreFonts))

CoreFonts is definded in line 117

$this->CoreFonts = array('courier', 'helvetica', 'times', 'symbol', 'zapfdingbats');

Sure, I added the namespaces and stuff. I think it lies somewhere at the CoreFonts-array.

How to fix this?
I'm also using only one font for a simple PDF, so maybe we can turn this 'look for font'-thingy off?

Here the full fpdf.php

Well, the answer was somewhere else.

Leaving everything like it is and creating a class with $pdf = new FPDF(); would result in an error because the class couldn't be found.

I'm quite new to PHP and I saw something with namespaces inside the error-message, so I added the namespace into the fpdf.php file.
Now the class could be found, but there was the problem which is described above.
Actually it's described wrongly, the problem was, that the $this variable was permanently NULL.

Well, it was almost as hard like Dark Souls 2, but I finally got the solution:

Instead of $pdf = new FPDF();
use $pdf = new \FPDF();

It has something to do with namespaces, again.

I thought I'd post my answer for newbies like me who want to use a TYPO3 custom action to create PDFs inside an extension.