turned ajax php echos to die() to simplify json result processing; also started a $totalHTML var to allow creation of an html page instead of a pdf. Still need to add front-end for html file feature.