Apple has a feature called “Back To My Mac” service to set up and print to a printer from any location. This is really good as if you want to print over the internet, you will have to set up the IPP protocol and have static IP address for your network so that you can forward communication ports.
So now, we will see how to make this happen.
> The first step is to configure your printer, just use the Print & Scan system preferences.
Note: This can be a attached or a networked printer.
> Go to Sharing system preferences and enable the newly configured printer.
> Modify access restrictions in the preference pane and make it only allow your account to print.
> Enable your iCloud account so that you can now locate your computer from anywhere.
> Now enable Back To My Mac service in iCloud and this will allow your system to be located from any other Mac you have configured with iCloud.