Added ai2pdf function