Last post Mar 05, 2010 05:10 AM by vijay_sutaria
Dec 01, 2008 10:11 AM|hjan|LINK
I hope someone can help me.
We have HTML documents stored in a database table, and we use them to send emails, or view them on screen. In our application we add certain parameters to the HTML text before sending the email, e.g.
Customer number, Due date etc. The HTML works great because we are able to format, add graphics etc., and is required for the emails.
Some customers may want to get the documents in the post instead of as an email, so I would like to be able to print these same HTML documents. How can I do that?
I need to be able to choose the queue I'm sending them to, as they often needs to be printed at a dedicated print facility in batch. The System.Printing namespace functionality looks great, but how do
I add the HTML document to the Job? You could say that I would like to create the document in the print queue in the same way as I'm creating it in an AlternateView for a MailMessage.
We are on .NET 3.5 using C#
Printing HTML batch
Dec 05, 2008 12:54 AM|Nai-Dong Jin - MSFT|LINK
From your description, it seems that you want to print the html contents in the database, right?
Basically, as one of the general way is rendering these html markup in a page, and invoke the built-in print function in browser. You can create a page, and it
can refresh automatically, it requests for new html contents every time, and it render different html markup onto the page and call the printing function, send the print job to the printer.
“it requests for new html contents every time”
à How to achieve that? Actually you can add a new field in your datatable, add a flag which indicates if the record has been
requested (printed), find those records with false flag and update the field to true while you get the record.
Dec 05, 2008 06:49 AM|hjan|LINK
Thank you very much for coming back to me.
Do you know if there is a way to print it to a printer of my own choice. There is a need for the operation to manage printers and queues in a batch environment. For other print, e.g. of a word document saved as a PDF or XPS I can send it to the right queue,
but I'm struggling with the HTML.
Thanks for the tip with the new column on the table. We are already working with a request table where rows are deleted after succesful execution, either via email or (hopefully) print, so that should be ok.
Mar 05, 2010 05:10 AM|vijay_sutaria|LINK
I am also facing the same problem.
I have a html string (I have generated this using the ctrl.RenderControl()), I am using this string to send a mail. now i have to add print functionality too.
So i am trying to use this same string to print it.
I have tried with "PrintDocument" but its not supporting HTML string. its printing whole string as it is.
So i want to ask you that how can i print HTMLstring ?
Please help me.