method for convert chart to pdf