EDN Admin
Well-known member
Hi all<br/><br/>I have this basic setup:<br/>An InfoPath formular is deployed to Forms Server, and a user fills it out. When the user submits the form, I need to somehow convert the form to PDF and attach it to an email sent to the user.<br/><br/>Now, this should be done in .NET code. I am still not quite sure if I will do it as an event handler on the Forms Server og if I will let the document go through BizTalk and let it to the conversion... but in any case, what I have is an .XML file that is actually the filled out form and I need to convert it to PDF that matches how the form looks like, naturally.<br/><br/>I have seen this thread:<br/> http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9f43f377-dfd6-4c6e-a361-315bf30f3c91 http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/9f43f377-dfd6-4c6e-a361-315bf30f3c91 about it, and I ahve tried doing what it says. But I cant get it working.<br/><br/>I have installed this one:<br/> http://www.microsoft.com/downloads/details.aspx?familyid=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en http://www.microsoft.com/downloads/details.aspx?familyid=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en and it seems to work - I can now save as PDF in Word, Excel and so on.<br/><br/>Then I created a Winforms program (it wont always be in a winforms program, but for testing purposes...) and I did this:<br/>1. Add the InfoPath Form control to the toolbox (Crogram FilesMicrosoft OfficeOffice12Microsoft.Office.InfoPath.FormControl.dll)<br/>2. Drag the Control which now appears in my tool box to my winform.<br/><br/>Then I added this code to some event of the form:<br/><span style="font-size:x-small <br/>string file = <span style="font-size:x-small;color:#a31515 <span style="font-size:x-small;color:#a31515 ""<span style="font-size:x-small ;<br/><span style="font-size:x-small formControl.Open(file);<br/>formControl.XmlForm.CurrentView.Export(<span style="font-size:x-small;color:#a31515 <span style="font-size:x-small;color:#a31515 ".pdf"<span style="font-size:x-small , Microsoft.Office.InfoPath.ExportFormat.Pdf);<br/><br/>Now, the issue is, that the "Export" method and the "ExportFormat" enum are not recognized and therefore give compile errors.<br/>The only difference between my using statements and the ones in the thread above is that I do not have this one:<br/><span style="font-size:x-small <br/>using Microsoft.Office.InfoPath.FormControl;<br/><br/>since that name space does not seem to exist - I only have the Microsoft.Office.InfoPath name space. Yes, the Microsoft.Office.InfoPath.FormControl.dll is referenced in my project.<br/><br/>Any thoughts?<br/><br/>My setup:<br/>Visual Studio 2008 with .NET 3.5 SP1<br/>Office 2007, English<br/>Windows XP<br/><br/>Thanks
<hr class=sig>
eliasen, representing himself and not the company he works for.<br/>MVP and three times MCTS in BizTalk.<br/>Blog: http://blog.eliasen.dk
View the full article
<hr class=sig>
eliasen, representing himself and not the company he works for.<br/>MVP and three times MCTS in BizTalk.<br/>Blog: http://blog.eliasen.dk
View the full article