Export Infopath xml-File to Pdf with Managed Code - InfoPath Dev
in

InfoPath Dev

Export Infopath xml-File to Pdf with Managed Code

Last post 05-23-2011 11:30 AM by BJ Johnston. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-21-2007 12:22 AM

    Export Infopath xml-File to Pdf with Managed Code

    Hello!

    I'm trying to export an Infopath 2007-Form to PDF/XPS with Managed Code. The problem was discussed in several posts in this forum, but none of the solutions were really suitable
    for me, so I try one more attempt. I've installed the Infopath 2007 - AddIn and was succesful this way:

    infPath = @"C:\toexport.xml";
    Microsoft.Office.Interop.InfoPath.Application InfApp = new Microsoft.Office.Interop.InfoPath.Application();
    XDocument InfXDoc = InfApp.XDocuments.Open(infPfad, (int) XdDocumentVersionMode.xdCanOpenInReadOnlyMode);
    InfXDoc.View.Export(@"C:\exported.pdf", "PDF");
    InfXDoc.View.Export(@"C:\exported.xps", "XPS");
    InfApp.Quit(true);
    InfApp = null;

    There ist only one fault: Infopath opens an application window and shows the form. Does anybody knows a way to access the file without the window?
    And can i select the view i want to export? Seems it always takes the standard-view?

    Thank You!

  • 08-21-2007 06:37 AM In reply to

    Re: Export Infopath xml-File to Pdf with Managed Code

    Hello

    Please read the Link below

    http://enterprise-solutions.swits.net/infopath2007/export-infopath-2007-form-to-pdf.htm

    I hope it will help you

    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 05-19-2011 10:16 AM In reply to

    Re: Export Infopath xml-File to Pdf with Managed Code

     Hi Kalyan,

    I know that there have been four years since you posted that link, but I am interested in exporting an InfoPath form to PDF.  The web site is now parked and no longer has the content you referenced.  Do you have any other links that have similar information?

     Thanks,

     William H.

     

     

    Filed under: ,
  • 05-23-2011 11:30 AM In reply to

    Re: Export Infopath xml-File to Pdf with Managed Code

    Hi William,

    Have you tried one of the the free PDF tools that installs as a virtual printer (i.e. CutePDFWriter)?

    Filed under:
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.