Hello,
This is a solution I've use in early 2007, so there may be a better way to
do it now. I hope there is
This way is not simple at all and requires
several steps to get it to work. We needed this solution in order to covert
any InfoPath form to a PDF on demand as a background process, without loading
the InfoPath client. We couldn't find a way to do this simply, hence the
following solution...
The basic process is as follows:
1. Create an InfoPath view that will be formatted for your printing
2. Extract the XSL from the InfoPath template and store somewhere for later
use (by saving InfoPath template as source files)
3. Use .NET (or similar) to transform the InfoPath data (i.e. Xml file)
using your XSL file into HTML (which is what InfoPath does when it displays a
view)
4. Use a HTML->PDF utility to create the PDF (there are heaps of 3rd-party
solutions to do this)
You can then call your process whenever you want to transform an Xml file
and generate your output.
Some traps:
- If you are adding images to your InfoPath output InfoPath auto-renames
them to keep them unique, so you usually need to manually find the name of
the image file in your XSL file so the converter can reference it
- Upgrades to your Xml may be required to get your output correct if you are
making changes to your InfoPath form
Like I said, this is doable but not nice. If I get some time this week I'll
write up some more detailed instructions.
HTH
Gavin.