Forum Moderators: open
Been presented with a task, and I don't really know where to start, so I was hoping you lot could throw some ideas about that I could experiment with.
Basically, I have a number of Microsoft Word templates, with Bookmarks defined in them. I also have an ASP.NET site that, at the moment, populates the bookmarks of the selected template and prints it out.
This is ok, but not great. I need some way to preview the document before printing it, and maybe even allow the user to fine-tune the document (correct any mistakes, etc). The user needs to then choose whether or not to print, and choose where to print to (ie, which network printer)
The server I'm working on has Word and PDF capabilities, on a local Intranet.
Has anyone had experience with this, or got any helpful suggestions? I'm not really looking for a specific implementation here, but rather a broad range of ideas that I can investigate. Only then will I start a new thread begging for help!
Cheers guys - appreciate anything you have!
B
If you wanted their changes to be saved back to the server then that would be a lot more tricky.
Finished tweaking my solution last Friday - I've ended up using the Microsoft Office Document Printer to produce the document, then the user is prompted to save the document, then they can print it, or leave it.
Not actually put this live yet, but works pretty well!
Cheers for the advice,
B
I'm now going with the whole streaming to the browser thang.
Basically, the code I'm using is as follows....(where doc is the contents of the document to be printed, as a string)
Response.ContentType = "application/msword";
System.Text.Encoding enc = System.Text.Encoding.ASCII;
byte[] b = enc.GetBytes(doc); /* doc is the contents of the document to be displayed */
MemoryStream imgData = new MemoryStream(b,true);
Byte[] LogoOuput = imgData.ToArray();
Response.AddHeader("Content-Disposition", inline;filename=Report");
Response.OutputStream.Write(LogoOuput,0,LogoOuput.Length);
Response.End();
Rather easy!
B