Conversion of infopath (2010) to pdf using the interop assmebly Microsoft.Office.Interop.InfoPath - InfoPath Dev
in

InfoPath Dev

Conversion of infopath (2010) to pdf using the interop assmebly Microsoft.Office.Interop.InfoPath

Last post 06-29-2012 03:01 AM by [email protected]. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-19-2012 03:03 AM

    Conversion of infopath (2010) to pdf using the interop assmebly Microsoft.Office.Interop.InfoPath

    Hi all,

    I'm using infopath 2010 and my requirement is to convert the infopath to pdf file.  I created a event receiver project and i added the reference to this interop assembly (Microsoft.Office.Interop.InfoPath ).

    In my scenario i need to convert the xml file of the infopath form which i published in the form library into a pdf file. So i wrote the code in the update item event as follow

    public override void ItemUpdated(SPItemEventProperties properties)

    {

    base.ItemUpdated(properties);

    try

    {

     

    string url = properties.ListItem.Url;

    string infPath = properties.WebUrl + properties.ListItem.Url;

    Microsoft.Office.Interop.InfoPath.Application InfApp = new Microsoft.Office.Interop.InfoPath.Application();

    XDocument InfXDoc = InfApp.XDocuments.Open(infPath, (int)

    XdDocumentVersionMode.xdCanOpenInReadOnlyMode);     // I'm getting the exception in this line as "Infopath cannot open the file say abc.xml, Not enough storage is avaialble to complete this operation

    InfXDoc.View.Export(@"http://trvmosadvw005:7698/PDFTest/abc.pdf", "PDF");

    InfApp.Quit(true);InfApp = null;

    }

    catch (Exception ex)

    {

    string str1 = ex.Message;

    string str2 = ex.InnerException.Message;

    }

    }

    Filed under:
  • 06-25-2012 10:13 PM In reply to

    Re: Conversion of infopath (2010) to pdf using the interop assmebly Microsoft.Office.Interop.InfoPath

    Please reply my above mail. I'm eagerly waiting for the reply.

  • 06-29-2012 03:01 AM In reply to

    Re: Conversion of infopath (2010) to pdf using the interop assmebly Microsoft.Office.Interop.InfoPath

    Hi,

    As someone who has worked on a product that provides InfoPath to PDF Conversion I have to warn you that it literally takes years of fine tuning to get this to work properly and reliably without making your environment unstable.

    Although I have worked on this product, and therefore am clearly biased, you should seriously consider evaluating the PDF Converter for SharePoint. It is used by many, well-known, organisations and does everything you need....and more.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.