fix to MakePDF for custom stylesheets