|
-
December 4th, 2002, 04:07 PM
#1
Formatted Printing in VB.NET
Does anyone know of a reference that pulls together all the pieces of the .NET Framework to explain how to do the same kind of formatted printing you used to do with the Printer object in VB6? -- Things such as Printer.CurrentX and Printer.CurrentY to position the next insertion point on a page, Printer.Print, Printer.NewPage, Printer.EndDoc. .NET breaks the Printer and if you want to do formatted printing you have to find all the pieces and put them back together. The 5 .NET books I have only contain references to dumping a file to the printer.
-
December 4th, 2002, 05:09 PM
#2
If I understand the question correctly this might help you...... it sure helped me.....
I'm not really sure what you mean with formatted printing, but this helped me print a page with pictures, different strings formated with different fonts and colors and so on.....
Simple printing
/Leyan
-
December 4th, 2002, 05:30 PM
#3
Thanks
Athley,
Yes, I downloaded that package some time ago from Microsoft and looked at it. It contains some helpful information, but basically what it's doing is taking a file -- which in this case happens to be in a text box -- and dumping it out, line by line, to the printer. I understand how to do that thanks to that sample and to some of the VB .NET books I have.
What I need to do is this: Say you want to construct a form from inside your program. To do this you need to be able to move around the virtual page in memory and print various lines, then send the whole thing to the physical printer. You do that in vb 6 by saying something like "Printer.CurrentX = 850; Printer.CurrentY = 1024; Printer.Print strMyString." Then you move somewhere else on the form and print again. You may even print some lines to emphasize some of the printing. When you're finished with the page you say, "Printer.NewPage" (or, if that's the only page you're going to print you say, "Printer.EndDoc."
I'm sure it's quite possible to do that out of VB .NET, but there are a bunch of classes that have to be pulled together to do things like setting the font, moving to a position, printing a string, and ejecting the page. Part of the answer is in the Microsoft file you referenced. That tells you how to print a virtual page in memory and dump it out, but the positioning, etc. isn't there. I'm looking for something that gives shows how to do it all.
Regards
-
December 5th, 2002, 03:14 AM
#4
Isn't there only one client rectangle for printing in that example? And then couldnt you work out the positioning with more than one rectangle?
In the last project I made I had to print everything to specific positions and some dynamic positions all over the actual page and I saw no problem with that.
/Leyan
-
December 5th, 2002, 06:08 AM
#5
Again -- Thanks
Athley,
I suspect you may be right. I'll try using rectangles and see if that doesn't do what I want. Seems to me I remember having to use rectangles for something like that when programming Windows in C.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|