Since MODx is not parsing this resource, the MODx tags in your resource content are being shown as-is. You’re going to have to fetch the fields you want yourself and pass them on to the PDF generator.
Your snippet only fetches the content and the longtitle. If you want the description, you need to also fetch the description field.
$doc = $modx->getPageInfo($id,1,'content');
$title = $modx->getPageInfo($id,1,'longtitle');
$desc = $modx->getPageInfo($id,1,'description');
Then add it to your output wherever you want it.
This line
$id=$modx->db->escape($_GET['docid']);
is not appropriate in this case; what you really need to do with the $_GET[’docid’] is make sure it’s numeric. GET values are always a string, so you can’t use is_int, but is_numeric will do fine. Probably best to just quietly fail if is_numeric returns false.
if(!is_numeric($_GET['docid'])) { return; }
http://php.net/manual/en/function.is-numeric.php