for that to work, you need to have the button open...
# suitescript
j
for that to work, you need to have the button open a new window and use a suitelet to render the pdf