Monday, July 8, 2013

Attach PDF to Chatter Feed Item in Salesforce

Generating PDFs in Salesforce is pretty straight forward using the standard Visualforce page functionality of renderAs=pdf. Attaching those PDFs to a chatter post and having them render correctly as PDFs can be a little tricky. Below I have created a very simple Visualforce page and controller to demonstrate this functionality. (Also this solution has been tested and works in the three major browsers: Chrome, Firefox and IE)