How to show/hide "printer-friendly version" link according to workflow states? There's a review content type on my site with a workflow: I use 'draft' and 'completed' workflow states. 

I'd like to create a printer-friendly and pdf-version of 'finished' reviews only, so I'd like to hide the links generated by Print module in any other case.
I tried to modify MYTHEME__preprocess_node() to achive this with this code, but it didn't work:

if($vars['field_review_workflow'][0]['value'] == '13'){ //sid of 'finished' state
  show($vars['elements']['links']['print_html']);
}else{
  hide($vars['elements']['links']['print_html']);
}


How could I do it properly?
One way of doing it is by using hook_node_view_alter(). For example, you would put the following code in a custom module called hideprint (see many tutorials online on how to create a custom module). Be sure to dpm() the array $build when you are testing the module to correctly check the value of field_review_workflow.

function hideprint_node_view_alter(&amp;$build) {
  if ($build['field_review_workflow'][0]['#value'] == TYPE_VALUE_FOR_NOT_FINISHED){
    hide($build['links']['print_html']);
    hide($build['links']['print_pdf']);
  }    
}