Saving InfoPath form as image file.

J

JDeats

So the organization I'm employeed with wants me to use InfoPath forms
as part of a custom workflow solution we've built around Microsoft
technologies. All has gone well, up untill recently when I approach the
end of the process where I intend to insert the completed forms into
our content management system (in our case EMC Software Legato), part
of this requirement is that we place the documents in this system as if
they were scanned or faxed in (i.e. images in TIFF format).

So my custom application needs to be able to automate this process of
opening infopath, loading the desired form, then somehow extracting it
to a TIFF file. I was happy to see Microsoft provides a automation
type library for InfoPath 2003, so I set a reference and began. Then I
discovered InfoPath offers no way to extract or save a form as an image
file! (Why Microsoft? This is sort of essential in content management
storage). No worries (yet) I figured I could use Microsoft Office
Imaging which provides a nice MDI/TIFF print driver. From my custom
application, I figured I could just use COM automation to load my
InfoPath form then "print" it to a TIFF. Frustrating enough, this
approach almost works(!), unfortunately going this route the Office
Imaging driver prompts for a filename and if one isn't entered it
kindly performs a cancel operation. I'll note here that most other
Office applications: Word and Excel for example, bypass this problem by
offering a "OutputFilename" attribute as one of the .PrintOut method of
these objects, InfoPath's automation provides no attributes.

Here's my C# code, this is using the InfoPath type library for
automation from a custom Windows Forms application.

ApplicationClass app = new ApplicationClass();
XDocumentsCollectionClass xdocs =
(XDocumentsCollectionClass)app.XDocuments; XDocumentClass xdoc1 =
(XDocumentClass)app.XDocuments.Open(@"c:\myInfoPathForm.xml", 0);
xdoc1.PrintOut();
xdocs.Close(0);
app.Quit(true);


So now it looks as if we might have to abandon using InfoPath, other
forms software (e.g. Captiva) apparently does this with ease). Why
Microsoft? Why?
Shame...
 
J

JDeats

Just wanted to follow up and say that I found a solution using a
third-party TIFF print driver. For anyone else looking to convert
InfoPath forms into a TIFF file, look at the Zan Image Print Driver.
For about $40 per license.

See
http://www.zan1011.com/

You can try before you buy, but there's a 15-page "print limit" for
multi-page TIFFs. ZAN's Image print driver offers an array of features
not found in the Microsoft Office Imaging print driver, including a
filename, auto-generate feature that includes Macros.

I'm still looking for an answer as to why is the Microsoft Office
Imaging MDI/TIFF print driver so limited. Putting any thought in
content management integration, one would think Microsoft would have
realized how important this component is. Perhaps they assumed no one
would use it, and that the Adobe PDF print driver would be the most
common path developers would take.

-Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top