none
To Convert Browser enabled Infopath form 2007 to PDF format

    Question

  • Need to convert Browser enabled infopath form to PDF format in a click of a button. Could you please a give a suitable reference that would help me to implement the requirement.

    Thanks in Advance


    Shameej
    mercredi 14 septembre 2011 12:07

Toutes les réponses

  • Try this one:

    http://www.codeproject.com/Questions/102680/How-to-convert-infopath-form-into-pdf-or-word?display=Print

    Not well formatted but seems to cover what you are trying to do.

    Hope this helps

    Ed

    mercredi 14 septembre 2011 16:58
  • Thanks Ed. That was informative.

    But as you said, its not well formated. I want something which can convert Infopath 2007 to PDF to its original format.

    I have multiple tables, cascading repeating tables,multiple views in the infopath farm.

    I believe converting Infopath 07 --> (MS Word or HTML) --> PDF is a better option to get it in a well format. Please share thoughts on this.


    Shameej
    • Modifié shameej vendredi 16 septembre 2011 07:02
    vendredi 16 septembre 2011 07:02
  • I am now trying to achieve Infopath to PDF conversion through Infopath 07 --> (MS Word or HTML) --> PDF

    As far as I reached, I was able to convert Infopath to HTML, now I need to convert the HTML code to PDF through C#. Please provide any reference for this.


    Shameej
    lundi 19 septembre 2011 11:32
  • Hi Shameej,

     

    Have you gone through this Link --> http://www.bizsupportonline.net/infopath2007/export-infopath-2007-form-to-pdf.htm 


    Thanks & Regards Posting is provided "AS IS" with no warranties, and confers no rights.
    lundi 19 septembre 2011 12:21
  • Hi Zoeb, my infopath is browser enabled, so the link which you have provided is only for Client Application Infopath form and not for browser enabled Infopath form.

    As such I am re-posting my previous question:

    I am now trying to achieve Infopath to PDF conversion through Infopath 07 --> (MS Word or HTML) --> PDF

    As far as I reached, I was able to convert Infopath to HTML, now I need to convert the HTML code to PDF using C#. Please provide any reference for this.


    Shameej
    lundi 19 septembre 2011 13:37
  • Any update on this?

    Any reference to convert the HTML to PDF using C# without a third party tool?

    Thanks in advance


    Shameej

    • Modifié shameej mardi 20 septembre 2011 14:15 spell check
    mardi 20 septembre 2011 14:14
  • Hi ... were you able to go from HTML to PDF using c# or any third party library ? Please let me know ... Any help will be appreciated ...


    Dhaval Raval
    mardi 11 octobre 2011 19:38
  • Hi,

    Did you come right?  I also need to convert a browser enabled form to PDF or Word.

    Thanx

    Yusuf

    mardi 31 janvier 2012 15:02
  • Hi,

    There is no easy way to convert InfoPath Browser Form to PDF without using a library.

    But this is easy to convert InfoPath Form to HTML.

    After you can use for example a free library called "WKHTMLtoPDF" provide by google that allow you to convert HTML render to PDF.

     

    Hope this helps.

     


    Visit my blog : http://rmatayron.blogspot.com/
    mardi 31 janvier 2012 20:18
  • Hi Rémi,

    Thank you for replying.

    How do I convert InfoPath form to HTML?

    Thanx

    Yusuf

    mercredi 1 février 2012 06:16
  • Hi,
    You can use the following C# code :
                    
    		// Get an xml document from your InfoPath data
    		XmlDocument XmlFile = new XmlDocument();
    		XmlFile.PreserveWhitespace = true;
    		XmlFile.LoadXml(this.MainDataSource.CreateNavigator().OuterXml);
    
    		// Get the InfoPath view name that you want to apply to get HTML
    		Stream sxslFile = this.Template.OpenFileFromPackage("VueHTMLFormat.xsl");
    		// Create a resolver with default credentials.
                    XmlUrlResolver resolver = new XmlUrlResolver();
    
                    resolver.Credentials = System.Net.CredentialCache.DefaultCredentials;
    
                    // transform the xml file to html
                    XslTransform transform = new XslTransform();
    
                    // load up the stylesheet
                    XmlReader xlsFile = XmlReader.Create(sxlsFile);
                    transform.Load(xlsFile, resolver);
    
                    // Transformation in a stream
    		string strHTML = string.Empty;
                    using (MemoryStream ms = new MemoryStream())
                    {
                        transform.Transform(XmlFile, null, ms, resolver);
    
                        ms.Position = 0;
                        StreamReader sr = new StreamReader(ms, System.Text.Encoding.Default);
                        strHTML = sr.ReadToEnd();
                        sr.Close();
                    }
    
    With this, i think you have all in your hand to do what you want

    Visit my blog : http://rmatayron.blogspot.com/

    mercredi 1 février 2012 08:01
  • At the bottom of the article linked to by Zoeb there is this related one:

    Printing InfoPath 2007 Web-based Forms to PDF
    http://www.bizsupportonline.net/browserforms/print-infopath-browser-form-pdf.htm

    I'm in need of the same solution and would prefer one with less coding, though that is probably unlikely.

    jeudi 23 février 2012 19:54