working pdf-generation