You need to sign in to do that
Don't have an account?
alivepjc
Print envelope C# .net
Hi guys,
quick question. I wrote this app in c# .net that returns the billing address for any account entered. I need to print that address in an envelope size 10. I don't know how to do it. can anybody give me a hand please.
thanks!
chris
Hi alivepjc,
I would check out the Visual Studio Tools for .Net or the Word object model. It is very conceiveable that you could write a simple .NET addin to mail merge in to an envelope. Printing to an evnvelope requires that you choose an application that can print and Word has a lot of envelope formats available.
Does this sound like what you want to do?
I can open up word and print it from there, but I was wondering if there is a way of sending it directly to the printer...
thanks!!
There's quite a bit not shown here that is non-trivial. In our environment we have set printers for certain tasks. For example this is from my invoice printing code. Our invoices are printed on a dot matrix printer on 3 part forms. So it's always going to be on that printer. The desktops are also standardized on certain printers as well, making margins easy.
When you actually layout the objects on the page in C# you'll have to take special care to handle page margins and scaling. On an envelope it's not so bad, you'll probibly only have a few objets to layout, but on a full page it's a bit different. I'll leave that to you.
awesome! thank you! I still have one more question though...
I want to print a string, how do I draw the string? how do I send it to the printSheet.Print() method?
I promise I'll get my .net books!!!
This'll attach the function printSheet_PrintPage() to the page so that it knows how to 'draw' on it.
The function call will look like this:
Once in the function call you call to draw the text. Look up the call on MSDN for more detail.