Saving the plot generated inside root macro

Hi,
So I have plotted a histogram. Now is there a command that can be given inside the macro which will allow me to save this in a folder in pdf format. ( I should be also able to set the path of the folder where I want to save this).

Thanks a lot