Added PHP class for PDF plus minor changes