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...
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...