Getting the nid for a teaser I know how to get the nid for a node, but not for a teaser. I want to show a button in the teaser, created by a field with the PHP filter, that allows printing the node to pdf, but that requires the nid. The functions that work in the node, like menu_get_object(), don't work in the teaser.

Googling this has only brought up methods of printing a teaser if you already know the nid, not getting the nid if you only have the teaser. It should be available; it appears in the id for the teaser.

EDITED: I went with the suggestion posted below by f0ns. I don't understand why the nid is not available when it's in the teaser's id in the html, but that seems to be the case.
Use hook_node_view and for $view_mode == teaser you can add your logic.

https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_view/7