Convert Web Based InfoPath Form via Form Services to a PDF<p>Hello,</p> <p> </p> <p>Does anyone have a good idea on how to convert a web based InfoPath form into a PDF?</p> <p> </p> <p>I've been looking into the MOSS Document Conversions, which could prove quite interesting. OOB, It allows to convert from InfoPath Form to Web Page (Web Publishing Page). Does a converter like &quot;InfoPath Form to PDF&quot; exist? Or perhaps just a &quot;InfoPath to plain PDF&quot; exist?</p> <p> </p> <p>I've also been looking into the <a title="http://www.websupergoo.com/abcpdf-1.htm" href="http://www.websupergoo.com/abcpdf-1.htm">http://www.websupergoo.com/abcpdf-1.htm</a> - ABCPDF component. It's quite clever, as it's able to take a URL as a parameter and return the web page as a searchable PDF (not just an bitmap image). However it fails converting any pages coming out of SharePoint / Form Services (even though it actually supports JavaScript).</p> <p> </p> <p>Hit me back on any suggestions and ideas you have on this subject.</p> <p> </p> <p>Kind regards.</p>© 2009 Microsoft Corporation. All rights reserved.Mon, 05 Oct 2009 04:20:21 Z9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aahttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aahttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aaanchorPointDKhttp://social.msdn.microsoft.com/Profile/en-US/?user=anchorPointDKConvert Web Based InfoPath Form via Form Services to a PDF<p>Hello,</p> <p> </p> <p>Does anyone have a good idea on how to convert a web based InfoPath form into a PDF?</p> <p> </p> <p>I've been looking into the MOSS Document Conversions, which could prove quite interesting. OOB, It allows to convert from InfoPath Form to Web Page (Web Publishing Page). Does a converter like &quot;InfoPath Form to PDF&quot; exist? Or perhaps just a &quot;InfoPath to plain PDF&quot; exist?</p> <p> </p> <p>I've also been looking into the <a title="http://www.websupergoo.com/abcpdf-1.htm" href="http://www.websupergoo.com/abcpdf-1.htm">http://www.websupergoo.com/abcpdf-1.htm</a> - ABCPDF component. It's quite clever, as it's able to take a URL as a parameter and return the web page as a searchable PDF (not just an bitmap image). However it fails converting any pages coming out of SharePoint / Form Services (even though it actually supports JavaScript).</p> <p> </p> <p>Hit me back on any suggestions and ideas you have on this subject.</p> <p> </p> <p>Kind regards.</p>Thu, 10 May 2007 21:29:12 Z2007-05-10T21:29:12Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#a7ac3e16-7696-40d2-b983-6719891f730ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#a7ac3e16-7696-40d2-b983-6719891f730aCedric1http://social.msdn.microsoft.com/Profile/en-US/?user=Cedric1Convert Web Based InfoPath Form via Form Services to a PDF<p>I've got the same requirement: convert an InfoPath 2007 browser form to a PDF document (server side solution).</p> <p>Of course you could just install a PDF printer on each client and that would work but I need a server side solution please help.</p> <p>I've seen a video demo by Dafina Toncheva from Miscrosoft (EC306) and she was using the document converter of MOSS &quot;From InfoPath to PDF&quot;. The feature seem to have disappear because Adobe seems to threaten with a lawsuit. It must be somewhere to download but where??</p>Mon, 25 Jun 2007 10:27:23 Z2007-06-25T10:27:23Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#cf2046d3-d62a-42c8-9a30-481abf1f6bb4http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#cf2046d3-d62a-42c8-9a30-481abf1f6bb4anchorPointDKhttp://social.msdn.microsoft.com/Profile/en-US/?user=anchorPointDKConvert Web Based InfoPath Form via Form Services to a PDF<p>Hmmm that is interesting.. I know that Microsoft pulled the PDF writing capabilities from the Office 2007 client package. But this feature was then later available as an add-in for download:</p> <p> </p> <p><a title="http://www.microsoft.com/downloads/details.aspx?familyid=F1FC413C-6D89-4F15-991B-63B07BA5F2E5&amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?familyid=F1FC413C-6D89-4F15-991B-63B07BA5F2E5&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=F1FC413C-6D89-4F15-991B-63B07BA5F2E5&amp;displaylang=en</a></p> <p> </p> <p>Not sure if that add-in is usable in any way on a MOSS 2007 server.</p> <p> </p> <p>Anyway, what you CAN do is rename your .xsn infopath template to .cab and open it. You'll find that all InfoPath views are nicely stored as .xsl stylesheets. So what you can do is perform a transformation of the .xml data file your infopath template saved with that .xsl file and you'll have some nice html that you can convert into a .pdf with a 3rd party component like:</p> <p> </p> <p><a title="http://www.winnovative-software.com/PdfTools.aspx" href="http://www.winnovative-software.com/PdfTools.aspx">http://www.winnovative-software.com/PdfTools.aspx</a></p> <p> </p> <p>One thing to be aware of though is that you might not be successful getting image files etc. from the .xsn file into your transformation.</p> <p> </p> <p>Anyway - this is a solution until the day where Microsoft might decide to release a real PDF Document Converter for MOSS.</p>Tue, 26 Jun 2007 07:23:07 Z2007-06-26T07:23:07Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#2d64489c-ea76-45d9-9e95-11320c53ed56http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#2d64489c-ea76-45d9-9e95-11320c53ed56Paul Kotlyarhttp://social.msdn.microsoft.com/Profile/en-US/?user=Paul%20KotlyarConvert Web Based InfoPath Form via Form Services to a PDF<p>if  you  save your info path form as source files, you will see that there is  a stylesheet for each view of your form. Write a sharepoint event handler or a custom page that will take your form data file, transform it into a web page using  XSLT and then use one of the open souce PDF generators to produce the pdf file. </p> <p>This is how form to pdf converter in MOSS 2007 is implemented.</p>Mon, 02 Jul 2007 18:32:29 Z2007-07-02T18:32:29Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#69fd7ccd-46d0-4d28-8c59-7f1caab0d084http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#69fd7ccd-46d0-4d28-8c59-7f1caab0d084alspeirshttp://social.msdn.microsoft.com/Profile/en-US/?user=alspeirsConvert Web Based InfoPath Form via Form Services to a PDF<p>Another problem that you'll run into is attachments. If your form has attachments, where do they go?</p> <p> </p> <p>Attachments are stored as a base64 blob in the infopath form, so it is fairly straightforward to write code to iterate through the attachments and store them somewhere else. </p> <p> </p> <p>I found using the email submit option in infopath was a good way to send people completed, read only forms. It works with Outlook 2003/2007, but not sure about other email clients.  Once it is on the clients machine, they can pdf it at their leisure. </p> <p> </p> <p>Cheers, </p> <p> </p> <p>Al</p>Mon, 02 Jul 2007 23:08:09 Z2007-07-02T23:08:09Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#904b326c-6e1d-4ee8-87bb-06545e080d88http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#904b326c-6e1d-4ee8-87bb-06545e080d88SYM Wong-A-Tonhttp://social.msdn.microsoft.com/Profile/en-US/?user=SYM%20Wong-A-TonConvert Web Based InfoPath Form via Form Services to a PDF<p>If you have Word on the server, you could use Word automation to print an InfoPath form to PDF. You would first have to convert the form from InfoPath to Word, and then use the Office 2007 save as PDF add-in to convert from Word to PDF (see <a title="http://enterprise-solutions.swits.net/infopath2007/article.php?t=use-word-2007-convert-infopath-2007-pdf&amp;c=infopath2007" href="http://enterprise-solutions.swits.net/infopath2007/article.php?t=use-word-2007-convert-infopath-2007-pdf&amp;c=infopath2007"><u><font color="#800080">http://enterprise-solutions.swits.net/infopath2007/article.php?t=use-word-2007-convert-infopath-2007-pdf&amp;c=infopath2007</font></u></a>). The advantage of using such a solution is that you won't be bound to printing just one view from InfoPath, because you basically decide what your form will ultimately look like when you design your Word document. The disadvantage of using such a solution is that Word automation on the server might not scale well.</p> <p> </p> <p>A second option is to use a third-party component with which you can programmatically create PDF documents. It is then just a matter of converting the XML from your InfoPath form to PDF. The advantage is that you'll have total freedom when constructing your PDFs and the solution should be more scalable than the Word option.</p>Tue, 17 Jul 2007 06:29:12 Z2007-07-17T06:29:12Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#3a342b8a-3220-44c0-a670-b54c356ae89ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#3a342b8a-3220-44c0-a670-b54c356ae89aTjWheelerhttp://social.msdn.microsoft.com/Profile/en-US/?user=TjWheelerConvert Web Based InfoPath Form via Form Services to a PDF I'm tyring to implement this exact soluition. (InfoPath to Html, Html to PDF) It works fine for simple infopath forms, I extract the cab, read the manifest, identify the views etc.  I'm using an XsltCompiledTransform to transform the xml and the view.  <br><br>The problem is that when I attempt to use a form with secondary data sources it errors with:<br><em>System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument'..</em><br><br>This probably happens because the view contains something like:<br><font color="#0000ff" size=2><font color="#0000ff" size=2> <p>&lt;</font></font><font color="#2b91af" size=2><font color="#2b91af" size=2>xsl:when</font></font><font color="#0000ff" size=2> </font><font color="#ff0000" size=2><font color="#ff0000" size=2>test</font></font><font color="#0000ff" size=2><font color="#0000ff" size=2>=</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>function-available('xdXDocument:GetDOM')</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>&gt;</p></font></font>The namespace included in the xsl is:<br><br><font color="#ff0000" size=2><font color="#ff0000" size=2> <p>xmlns:xdXDocument</font></font><font color="#0000ff" size=2><font color="#0000ff" size=2>=</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2>http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument</font></font><font size=2>&quot;</font><font color="#0000ff" size=2><font color="#0000ff" size=2> </p></font></font>Obvoulsy when InfoPath transforms the data it includes these functions somehow, although I'm not sure how.<br>I was thinking either a custom XmlResolver, or a different XSLT processor.  I was also checking my versions of MSXML but I think I have them up to date.<br><br>Has anyone else had this problem?<br><br>Sun, 18 Jan 2009 03:46:06 Z2009-01-18T03:46:06Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#9dafa098-e138-499e-ac86-e95132a45bf4http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#9dafa098-e138-499e-ac86-e95132a45bf4tholmAtDako.dkhttp://social.msdn.microsoft.com/Profile/en-US/?user=tholmAtDako.dkConvert Web Based InfoPath Form via Form Services to a PDFHave the same problem, though it's the <span style="font-size:xx-small;color:#008000"><span style="font-size:xx-small;color:#008000"><a href="http://schemas.microsoft.com/office/infopath/2006/xslt/User"><strong>http://schemas.microsoft.com/office/infopath/2006/xslt/User</strong></a> namespace which, gives me the exeption. Did you ever find a solution?</span></span>Thu, 02 Jul 2009 08:54:28 Z2009-07-02T08:54:28Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#98c27040-a1a3-4976-9972-a3be8d2267bbhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#98c27040-a1a3-4976-9972-a3be8d2267bbTjWheelerhttp://social.msdn.microsoft.com/Profile/en-US/?user=TjWheelerConvert Web Based InfoPath Form via Form Services to a PDF<p>Yes I did get a solution.  Basicallly I only process Print Views as they don't have any of the nasty xDocument stuff that I can't deal with.  <br/>I have built a component that does the following:<br/><br/>Locate the XSN document from the Pre Processor directives in the infopath XML file.<br/>Download the XSN<br/>Extract the contents as it is a CAB format<br/>Parse the manifest file and locate all the Views.<br/>Identify the Print View XSLT and transform it with the XML to give us HTML.<br/>I then use <a href="http://www.winnovative-software.com/">Winnovative Html to PDF converter</a> to generate a PDF.  As I have extracted the image files, the Winnovative component also renders them in the PDF which is great.<br/>I then stream the result back to the browser for the user to save.<br/><br/>Just a note on the Office Addin.  We could not get that to work successfully as a server side solution and cannot explain why.  <br/></p>Thu, 23 Jul 2009 06:10:45 Z2009-07-23T06:10:45Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#9a40609d-a86f-487d-aac8-901dc0dfb289http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#9a40609d-a86f-487d-aac8-901dc0dfb289Jason Ruthkoskihttp://social.msdn.microsoft.com/Profile/en-US/?user=Jason%20RuthkoskiConvert Web Based InfoPath Form via Form Services to a PDFTJ,<br /><br />Can you elaborate on what you mean by "Basicallly I&nbsp;only process Print Views as they don't have any of the nasty xDocument stuff that I can't deal with"?<br /><br />I'm having the same problem.&nbsp; I get HTML by grabbing the XSN file and adding it to my project as an embedded resource, but for a lot of the forms it only shows my top header even though the HTML code is there for the rest of the form.Fri, 02 Oct 2009 20:24:28 Z2009-10-02T20:24:28Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#f52d109e-751f-4ce8-9ec8-c19c3d7034e8http://social.msdn.microsoft.com/Forums/en-US/sharepointinfopath/thread/9f6e9ac7-cb20-41f7-b5ab-2a015c94b1aa#f52d109e-751f-4ce8-9ec8-c19c3d7034e8TjWheelerhttp://social.msdn.microsoft.com/Profile/en-US/?user=TjWheelerConvert Web Based InfoPath Form via Form Services to a PDFSure.&nbsp; A normal view, might have some infopath control in it, like a button or a date control.&nbsp; Some of these work by using special xslt functions that are part of the xDocument schema.&nbsp;&nbsp;I have not found much information about&nbsp;these functions.&nbsp; When I try and transform the xml and the "normal" view I get errors from the Microsoft XLST engine that it can't deal with those functions.&nbsp; I assume that InfoPath has a built in library that&nbsp;contains the definition for these functions.&nbsp; I was never&nbsp;able to transform these&nbsp;views.&nbsp; So my work around was to use a&nbsp;print view as infopath seems to cut out all of the stuff that causes the&nbsp;xlst engine to error, and I can transform it correctly.&nbsp; So the limitation I currently have in my InfoPath to PDF solution is that it will only convert forms that have a Print View.<br /><br />I'm not sure why you are not seeing all the html rendered.&nbsp; Are you transforming the xml with the print view xslt?&nbsp; I suggest saving it to the disk at each point Ie after XSLT trasnform as html, then after PDF conversion to see at which point that solution fails.<br />You may also want to check your version of MSXML, this can be out of date and cause odd issues.<br />Mon, 05 Oct 2009 04:20:21 Z2009-10-05T04:24:44Z