46686eafeb
There was a big proliferation and reuse of $pdf variable that was making the code hard to read/review. This commit does change nothing but makes it more readable. Also adds a couple of Close() calls, not strictly needed because they don't have opened files. But think it makes really clearer the scope of every variable. And, for sure it frees some resources. That cannot be bad.