Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everybody, this is my first time asking a question on Internet ever. So, I hope somebody help me on this particular situation:

I send raw data to a dot matrix printer perfectly BUT, I can't handle margins, I mean, when I send a file or a String to a method which sends to the printer, it is printed on the top left of the page without margins at all, and when it finishes the printer don't load the page, instead, it stops with the paper in it SO I need how to control it...
I import the 'winspool.drv' drive such as the example given by MSDN (my simple gift for you all: http://support.microsoft.com/?kbid=322091[^]), but I need more information about more configuration commands or whatever I need.

Uh! by the way, MSDN has forgotten one thing with their example: Put this line on the top of their class (needed for creating files):

using System.IO; Otherwise, It won't work

I hope my info help somebody as well, but...

Please help me too!!! It's C#. Thanks!

Francisco Roldan Arauz
Posted
Updated 28-May-10 2:19am
v2
Comments
Henry Minute 28-May-10 16:02pm    
Thanks for taking the time to reply, even though I was not able to help. I've just had a thought though. What if you send just an empty page using the Graphics Object with just the margins set as required, followed immediately by the raw data as is done now. I suspect that it won't work because the Graphical printing probably resets the margins when it ends. Worth a try though?
pancho2413 28-May-10 16:12pm    
Could you believe me that I was just thinking of doing the same thing? How can I give you extra points or some good grade??? If this print method doesn't work, doesn't matter, I tried hard... and you deserve my vote for answering as quick as I never thought

It looks like you are using an older technology to do printing. Why not use some newer stuff that makes things easier for you: Printing Using C#. That allows you to draw to a Graphics object, which then gets sent to the printer. You could handle margins by just not drawing on the edge of the Graphics object, but I think the API allows you to set the margin explicitly.
 
Share this answer
 
Comments
pancho2413 28-May-10 0:07am    
Thanks friend! You're right, I'm using old tech; buy the fact is that many enterprises-customers where I live work with dot matrix printers for reports, even for sale-tickets and for many other procedures. I know how to print using the second and last method: drawing objects for every printer (laser, matrix and many more) BUT my enterprises-customers need to print like the old school, the first method: raw data to a dot matrix printer
After reading your comment to the previous answer.

I think that you might have misunderstood what aspdotnetdev was suggesting.

The point is that by directing your output to the Graphics Object provided by the more recent methods, you can control the alignment, margins, headers and whatever else before sending it to the physical printer.

In order to influence margin settings directly on the printer you would otherwise have to know the codes for all possible printers your customers might be using.

If I have misunderstood your situation, please ignore this post. :)
 
Share this answer
 
Comments
pancho2413 28-May-10 15:43pm    
Thanks. Completely agree with both of you, in fact, I used to print drawing to a graphic object BUT my boss told me it's just necessary for laser or inkjet printers. I tried to print with graphics with a dot matrix and it prints ok, but if I send raw data to these kind of printers it work with the fastest mode ever, and the boss like it (he prints with this mode using FoxPro), customers like too. Sad world, but money comes even from people who doesn't understand what's better for their image corporation: Using dot matrix printers????? come on... Any way, they pay

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900