this is possible, you will need to code for that. something similar to below
this is for printing
Microsoft.Office.Interop.InfoPath.Application moipApp = null;
moipApp = new Microsoft.Office.Interop.InfoPath.Application();
XDocument docume = moipApp.XDocuments.Open(arguments);
docume.PrintOut();