Searching \ for '[TECH] Using low-level printer commands to perform' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=using+low+level
Search entire site for: 'Using low-level printer commands to perform'.

Exact match. Not showing close matches.
PICList Thread
'[TECH] Using low-level printer commands to perform'
2012\02\22@174529 by YES NOPE9

flavicon
face
I want to use a consumer grade inkjet printer for special printing.
For example I have some Canon MP250 printers available.
I want to attempt to issue low level commands like line feed or reverse line feed.
Using google has led me to PCL  ( aka PDL )  Also mentioned was PJL commands.

I am now trying to learn how to send commands to the printer.
I thought possibly through a scripting terminal app using Bash I could send commands.

Does anyone have any suggestions or links ?

Gu

2012\02\23@135506 by John Ferrell

face
flavicon
face
I have a low priority project in that direction. From where I stand it looks like a custom DLL is the easiest route in windows. I would hate to go that route and find out there is something easier available!


On 2/22/2012 5:45 PM, YES NOPE9 wrote:
{Quote hidden}

-- John Ferrell W8CCW
Be thankful we're not getting all the
government we're paying for. - Will Rogers

2012\02\23@140949 by Alex Harford

face picon face
How custom would the DLL be? Could you base it on a Gutenprint driver?

On Thu, Feb 23, 2012 at 10:55 AM, John Ferrell <spam_OUTjferrell13TakeThisOuTspamtriad.rr.com> wrote:
> I have a low priority project in that direction. From where I stand it
> looks like a custom DLL is the easiest route in windows. I would hate to
> go that route and find out there is something easier available

2012\02\23@143034 by John Ferrell

face
flavicon
face
I have a lot to learn about DLL's to be certain.
From what I think I know so far:
    DLL can access hardware without interference from Windows.
    Windows can pass parameters to DLL's

I am currently working (learning) in PowerBasic.
The reason for that language is that the other popular high level languages are priced out of sight for full featured products.

I don't know anything about a Gutnprint driver but I will google it.

On 2/23/2012 2:09 PM, Alex Harford wrote:
> How custom would the DLL be? Could you base it on a Gutenprint driver?
>
> On Thu, Feb 23, 2012 at 10:55 AM, John Ferrell<.....jferrell13KILLspamspam@spam@triad.rr.com>  wrote:
>> I have a low priority project in that direction. From where I stand it
>> looks like a custom DLL is the easiest route in windows. I would hate to
>> go that route and find out there is something easier available!

-- John Ferrell W8CCW
Be thankful we're not getting all the
government we're paying for. - Will Rogers

2012\02\23@144341 by Tamas Rudnai
face picon face
I thought you can still do a "copy filename.ext > LPT1:" command from the
cmd window? Have not checked that yet, but should not that work?

Tamas


On 23 February 2012 19:30, John Ferrell <jferrell13spamKILLspamtriad.rr.com> wrote:

{Quote hidden}

>

2012\02\23@145242 by Bob Blick

face
flavicon
face
On Thu, Feb 23, 2012, at 07:43 PM, Tamas Rudnai wrote:
> I thought you can still do a "copy filename.ext > LPT1:" command from the
> cmd window? Have not checked that yet, but should not that work?

I haven't seen an LPT port on computer or printer in about a decade.

VirtualBox doesn't have support for them even if the computer is
equipped with one.

Bob

-- http://www.fastmail.fm - Access all of your messages and folders
                         wherever you are

2012\02\23@155426 by V G

picon face
On Thu, Feb 23, 2012 at 2:30 PM, John Ferrell <EraseMEjferrell13spam_OUTspamTakeThisOuTtriad.rr.com>wrote:

> I have a lot to learn about DLL's to be certain.
>  From what I think I know so far:
>     DLL can access hardware without interference from Windows.
>     Windows can pass parameters to DLL's
>
> I am currently working (learning) in PowerBasic.
> The reason for that language is that the other popular high level
> languages are priced out of sight for full featured products.
>
> I don't know anything about a Gutnprint driver but I will google it.
>

By DLL, you're referring to Windows shared libraries, right?

Why not just experiment with the free Visual Studio or MinGW

2012\02\23@155530 by V G

picon face
On Thu, Feb 23, 2012 at 2:43 PM, Tamas Rudnai <tamas.rudnaispamspam_OUTgmail.com>wrote:

> I thought you can still do a "copy filename.ext > LPT1:" command from the
> cmd window? Have not checked that yet, but should not that work?
>

Yeah, in 1995.

They're a lot more complicated now, with custom drivers and USB and all
that

2012\02\23@162443 by Tamas Rudnai

face picon face
So this would not work? (See Answer 4)

http://superuser.com/questions/182655/how-do-i-simulate-a-parallel-lpt-printer-with-a-usb-printer

Thanks
Tamas


On 23 February 2012 20:55, V G <@spam@x.solarwind.xKILLspamspamgmail.com> wrote:

{Quote hidden}

>

2012\02\23@191412 by V G

picon face
On Thu, Feb 23, 2012 at 4:24 PM, Tamas Rudnai <RemoveMEtamas.rudnaiTakeThisOuTspamgmail.com>wrote:

> So this would not work? (See Answer 4)
>
>
> http://superuser.com/questions/182655/how-do-i-simulate-a-parallel-lpt-printer-with-a-usb-printer
>

Did not know that program existed. That certainly may work

2012\02\23@204519 by John Ferrell

face
flavicon
face
A windows DLL file allows access to a higher security level in the system than programmers are currently accustomed to.
Once upon a time a programmer was expected to get closer to the hardware. That allowed one to "Hack" a fit between existing hardware/software combinations and get functions out of the machine that were not intended. Printers were precious and hard to come by. Performance was lousy. I moved my Model 15 TTY from the TRS-80 to the PC with little problems. Later I acquired a selectric console writer from a big system in a similar fashon. It was no big deal, a lot of people were doing stuff like that.  Writing a program for making labels on whatever printer could be done by just about every one. As we eased up into Windows and multi tasking it was necessary that we give up that freedom and follow the rules by MS and the Vendors. I don't want to lose multi tasking, VM, secure systems etc. but I would like to regain at least part of the old freedoms to innovate.

I would like to have the freedom granted by Turbo 3 Pascal in today's world. It just is not to be.

If I ever get around to actually doing the DLL route,  a Driver would seem to be the next step.  Not likely by me, too many unknowns. All you have to do to get a DLL loaded is to ask nice.

Power Basic appears to me to be current, full featured and well documented. It has many generous Guru's that are quick to respond to beginner's questions. I may change my mind later, but for now, that is my take.

I have Delphi 3, 5, and 7,  Several varietys of  Visual Basic and Visual Studio. I expect I will embrace JAVA soon because my son gifted me with an Android.

The features I have found in popular vendors compilers usually are there to keep you from getting closer to the hardware.
All of todays compilers seem to generate bloated code.

Any one who has bee around a while has some hardware they would like to be able to use but there are no drivers available! If you had the interface specs and an intentionally simple compiler you could roll your own drivers with little effort.  But then you would not need the latest hardware & software....

K&R c, a preprocessor, documentation and a basic library would cure a lot of evils!

And that is why I am dreaming about .dll stuf...

On 2/23/2012 3:54 PM, V G wrote:
{Quote hidden}

-- John Ferrell W8CCW
Be thankful we're not getting all the
government we're paying for. - Will Rogers

2012\02\23@234237 by John Ferrell

face
flavicon
face
I totally misunderstood the question.
Referring to the WalMart ad for specs
 http://www.walmart.com/ip/Canon-PIXMA-MP250-Photo-All-In-One-Inkjet-Printer-Copier-Scanner-Value-Bundle/12534987#ProductDetail

I don't know how to send data to a USB device other than through a device driver as the vendor intended.
Sorry for any confusion...

On 2/22/2012 5:45 PM, YES NOPE9 wrote:
{Quote hidden}

-- John Ferrell W8CCW
Be thankful we're not getting all the
government we're paying for. - Will Rogers

2012\02\24@014045 by Tamas Rudnai

face picon face
Guys, I still don't get how a custom DLL would have a "higher security
level" or can "can access to the hardware"? That is only a Dynamic Linked
Library, not a driver (which has a SYS extension usually and runs in Kernel
mode -- aka Ring 0).

Or you are talking about a specific DLL that gives you an API to the
printer driver?

Thanks,
Tamas


On 24 February 2012 01:45, John Ferrell <TakeThisOuTjferrell13EraseMEspamspam_OUTtriad.rr.com> wrote:

{Quote hidden}

>

2012\02\24@084756 by Bob Ammerman

flavicon
face
>I have a low priority project in that direction. From where I stand it
> looks like a custom DLL is the easiest route in windows. I would hate to
> go that route and find out there is something easier available!

There is very little, if anything, that can be done in a DLL that can't be done directly in your application.

However, if your application is in .NET you have a bit trickier situation to call arbitrary Win32 APIs. You would need to use a capability called P/Invoke or Interop.

-- Bob Ammerman
RAm Systems

2012\02\24@085525 by Bob Ammerman

flavicon
face
> A windows DLL file allows access to a higher security level in the
> system than programmers are currently accustomed to.

This is not a true statement. DLL's operate under the security context of the calling application and have no special privileges.

> If I ever get around to actually doing the DLL route,  a Driver would
> seem to be the next step.  Not likely by me, too many unknowns. All you
> have to do to get a DLL loaded is to ask nice.

Drivers are another beast. They are difficult to write but do have the ability to do many things that a standared App/DLL cannot do.

> K&R c, a preprocessor, documentation and a basic library would cure a
> lot of evils!
>
> And that is why I am dreaming about .dll stuf...

-- Bob Ammerman
RAm Systems

2012\02\24@092045 by M.L.

flavicon
face
I have access to a USB analyzer. I could trace what happens when I
print a simple document. I'm guessing it'll be quite a lot of data to
decode. Aren't there free software drivers for printers? CUPS or
something? I think you could figure out the protocol via the software.

-- Martin K

2012\02\24@094104 by Bob Ammerman

flavicon
face
To send arbitrary data to a printer in windows .NET:

See http://support.microsoft.com/kb/322090

You can use the same logic to directly access the print spooler API from other languages.

Note that with this API you have to create the entire print stream byte-for-byte. Windows will do nothing to format text or graphics.

-- Bob Ammerman
RAm Systems

2012\02\24@105600 by John Ferrell

face
flavicon
face
Comments embedded. This is one of those times where revealing my ignorance leads to enlightenment.


On 2/24/2012 8:55 AM, Bob Ammerman wrote:
>> A windows DLL file allows access to a higher security level in the
>> system than programmers are currently accustomed to.
> This is not a true statement. DLL's operate under the security context of
> the calling application and have no special privileges.
Thank you, I am close to checking this out. I will prepare to be disappointed, I want direct hardware access



> If I ever get around to actually doing the DLL route,  a Driver would
> seem to be the next step.  Not likely by me, too many unknowns. All you
> have to do to get a DLL loaded is to ask nice.
> Drivers are another beast. They are difficult to write but do have the
> ability to do many things that a standared App/DLL cannot do.
Ouch! I hope I am up to the task...


-- John Ferrell W8CCW
Be thankful we're not getting all the
government we're paying for. - Will Rogers

2012\02\24@110655 by Bob Ammerman

flavicon
face
From: "John Ferrell" <jferrell13EraseMEspam.....triad.rr.com>
To: "Microcontroller discussion list - Public." <EraseMEpiclistspammit.edu>
Sent: Friday, February 24, 2012 10:56 AM
Subject: Re: [TECH] Using low-level printer commands to perform unusualprinteroperations


{Quote hidden}

John,

The good news is that if you are just writing a stream of bytes to a printer you can do it without worrying about direct hardware access. The technique involved is independent of the physical interface of the printer (USB, Serial, Parallel, or even a network printer).

To use the printer directly without involving Windows drivers you simply use the Windows spooler API. One of my earlier replies in this thread contains a relevant link.

-- Bob Ammerman
RAm Systems

2012\02\24@112245 by Kerry Wentworth

flavicon
face
You can get device drivers already written that allow you to directly access whatever port you want.

UserPort comes to mind.

Kerry



John Ferrell wrote:
{Quote hidden}

>

2012\02\24@125637 by V G

picon face
On Fri, Feb 24, 2012 at 1:40 AM, Tamas Rudnai <RemoveMEtamas.rudnaiEraseMEspamEraseMEgmail.com>wrote:

> Guys, I still don't get how a custom DLL would have a "higher security
> level" or can "can access to the hardware"? That is only a Dynamic Linked
> Library, not a driver (which has a SYS extension usually and runs in Kernel
> mode -- aka Ring 0).
>
> Or you are talking about a specific DLL that gives you an API to the
> printer driver?
>

It doesn't. It's just a shared library. It has as much access as the
program that's using it.

Drivers, on the other hand, are different

2012\02\24@125732 by V G

picon face
On Fri, Feb 24, 2012 at 8:55 AM, Bob Ammerman <RemoveMEpicramspam_OUTspamKILLspamroadrunner.com> wrote:

> > A windows DLL file allows access to a higher security level in the
> > system than programmers are currently accustomed to.
>
> This is not a true statement. DLL's operate under the security context of
> the calling application and have no special privileges.
>
> > If I ever get around to actually doing the DLL route,  a Driver would
> > seem to be the next step.  Not likely by me, too many unknowns. All you
> > have to do to get a DLL loaded is to ask nice.
>
> Drivers are another beast. They are difficult to write but do have the
> ability to do many things that a standared App/DLL cannot do.
>

There we go, this is correct

2012\02\24@125939 by Michael Rigby-Jones

flavicon
face


{Quote hidden}

A DLL is simply a library of functions that are loaded dynamically (i.e. at run time) rather than statically (at compile/link time).  This means a bunch of functions can be used by more than one program e.g. the Windows API functions.  A DLL has no other inherent magic apart from that which you code into it.


> > Drivers are another beast. They are difficult to write but do have the
> > ability to do many things that a standared App/DLL cannot do.
>
> Ouch! I hope I am up to the task...

Writing drivers is probably one of the most programming task under Windows (or Linux/Unix come to that).  Microsoft supply the Windows Driver Kit (WDK) for developing drivers if you really need to go down this path

http://msdn.microsoft.com/en-us/windows/hardware/gg487428

As Bob mentioned, the Windows Spooler will allow you to send raw (i.e. unformatted) data to the printer (Microsoft has some example code for this somewhere) but I'm not convinced this will offer you the control you need.  Some more detail on your requirements may be useful.

Modern cheap printers have relatively little in the way of "smarts" in them.. Typically you won't be able to control them directly using e.g. PCL or Postscript.  Instead the Windows driver performs any rendering required and sends the resulting raster image to the printer using low level commands which will be specific to the printer.  Details of the interface at this level will almost certainly be very difficult to find.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2012\02\24@131618 by Alex Harford

face picon face
On Fri, Feb 24, 2012 at 7:56 AM, John Ferrell <RemoveMEjferrell13KILLspamspamtriad.rr.com> wrote:
>> Drivers are another beast. They are difficult to write but do have the
>> ability to do many things that a standared App/DLL cannot do.
> Ouch! I hope I am up to the task...

The reason I mentioned Gutenprint is that people have already
developed the drivers, and modifying them is much easier that starting
from scratch. The Inkjet PCB guys have modified the Gutenprint drivers
to print over the entire area of the CD tray when they are using blank
PCBs. Normally the driver doesn't print where the hole in the CD/DVD
would be

2012\02\24@132631 by YES NOPE9

flavicon
face
>
> On Feb 24, 2012, at 7:20 AM, M.L. wrote:
>
> I have access to a USB analyzer. I could trace what happens when I
> print a simple document. I'm guessing it'll be quite a lot of data to
> decode. Aren't there free software drivers for printers? CUPS or
> something? I think you could figure out the protocol via the software.
>
> --
> Martin K.



MK
If you use the USB analyzer , I would love to learn what you find out.   ( please mention printer model )
I want to be able to send bytes to the printer from Linux.
Whatever works.   Gus








More... (looser matching)
- Last day of these posts
- In 2012 , 2013 only
- Today
- New search...