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!