WCF/WF - WCF printing options? - Asked By Stephen Schaal on 30-Mar-11 09:04 AM

I have a project coming up that I believe is best suited to WCF. I've always used web services in the past for something like this, but apparently WCF replaced them now that I have VS 2010 (or so I'm told). Anyways, I need to create a link to place on an external site, that when they used it sends info about the user to my wcf service, which will return customized content for printing to the user. The kicker is that it needs to be automatically sent straight to the print dialog, no form, no preview, just print the content on the user end. I realize it's probably bad form not to give the user a preview, but the requirements are pretty clear on the matter. I'm not even sure if WCF is setup to perform that way, but I figured I could ask you guys, and I could at least hear a "no thats impossible" if that is the case. Any thoughts?

thanks for all your help,
Peter Bromberg replied to Stephen Schaal on 30-Mar-11 09:53 AM
You would probably need to use a custom ActiveX component to do this, which pretty much restricts your "stuff" to Internet Explorer. Even if you loaded the page and issued the window.print javascript function, the user will stll get a print dialog and they still have to press a button to print. WCF really has little to do with this, it's just returning content.
Stephen Schaal replied to Peter Bromberg on 30-Mar-11 10:39 AM
Sorry for being vague, but all I ever hear is pci and iso this or that these days. I'm basically just trying to print the content of a html page, or a particular div of that page, which will contain some copy based on the values recieved by the WCF. So you would recommend using the WCF for the transporting?
Peter Bromberg replied to Stephen Schaal on 30-Mar-11 11:25 AM
You can get your data into the page however you want. If it's coming from a database, you can use ADO.NET. If you want to expose your methods as a service, then WCF is just fine.
Stephen Schaal replied to Peter Bromberg on 01-Apr-11 11:37 AM
I've actually talked the client into changing requirements based on usability issues, thank God. Thinking now we might go with creating a web service that accepts data, generates some content, and serve back a pdf (or any kind of image really) for them to display on their site. This is all pretty high level for me. but should be fun. Do you guys have any example of something even close to that?