Following is a function is PostScript using which you can…