I also have trouble getting this snippet to work at all.
Here is what I have done:
1. Created the snippet with the PrintDoc.snippet.php contents, called it PrintDoc.
2. Created a blank document (Called Print, ID 20). Pasted the following code in it [[PrintDoc? print_doc=`(20)` &tpl=`(Print)`]].
3. Used (blank) as a template for my Print document.
4. Created a chunk called Print and pasted the contents of Template.chunk.txt file.
5. Added the following code to the template where I wanted the print button to appear: [[PrintDoc? print_doc=`(20)`]]
This gives me a 404 as the print URL is not built properly in the Javascript link. I get this kind of link:
javascript:void window.open(’[~(20)~]&p_docid=3’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);
I then modified this line of the snippet code
$jslink = "javascript:void window.open(’[~$print_doc~]&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";
to
$jslink = "javascript:void window.open(’index.php?id=20&p_docid=$modx->documentIdentifier’, ’win2’, ’status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=500,height=500,directories=no,location=no’);";
This opens the popup window properly, but I get a "No documet Id set for the Printing page." message in it.