In the same function as above you can change
$filenmae = preg_replace(‘/[^a-z0-9]/i’, ‘_’, $single->post_title )
to
$categories=wp_get_object_terms( $post[0]->ID, ‘category’);
$filenmae = preg_replace(‘/[^a-z0-9]/i’, ‘_’, $single->post_title ).’ ‘.$categories[0]->slug;
if the posts like in my case only has one category. But these are temporary solutions
Possible solution to visitor download papersize is change to
$dompdf->set_paper( ‘a6’ , ‘portrait’ )in function download_post() in the plugins inc/core_class.php