Script to export documents upon release

I've been tasked with seeing if it is possible to export a *.pdf version of a drawing upon release. To this end, I've designed a python script which should do the trick, except I'm not entirely sure how to execute the script from within PDM. Is there a tutorial or example on this I can reference?

SolidworksApi macros