Client/server side PDF printing in pure JavaScript