Printing to serial/ ESC characters C++

C

carlospedr

I'm writing a dll in C++ to use a IBM 4610 SureMark printer.

I have some questions that i was hoping someboy would help me with:

How can I print a pdf file? Looking through the manual I wasn't able to
find anyting about that or even printing a image of any sort. Could it
be done using an escape sequence before sending the buffer
corresponding to the file?

In Commands that have like this, that written in the manual like this:
"ESC c 0 X'04': Select document station - normal print mode:..." the
"c", "0" are references to the ASCII code of "c" and "0"? I don't
understand very well this notation... since the other ASCII code is
written in its Hex form (X04).

Thank You for Help in advance,
Carlos Pedro
 
C

Christoph Lindemann

How can I print a pdf file? Looking through the manual I wasn't able to
find anyting about that or even printing a image of any sort. Could it
be done using an escape sequence before sending the buffer
corresponding to the file?

If you are sending the data directly to the printer, you cannot send PDF.
you probably have to send the raw image (bitmap) data. Allthough i do not
know what escape sequences are used by the 4610.
In Commands that have like this, that written in the manual like this:
"ESC c 0 X'04': Select document station - normal print mode:..." the
"c", "0" are references to the ASCII code of "c" and "0"?

the ESC c 0 X'04' sequence would be "1B 63 30 58 04" in hex

If you are printing from a windows application (you mentioned DLL), I
strongly suggest you use Windows GDI and the printer driver to render the
job on the printer. Or use the "IBM Point of Sale Subsystem" to program the
printer. They both provide a high level interface to the printer. The IBM
Point of Sale Subsystem also provides drivers for DOS.

For GDI, see the Windows Platform SDK.
http://msdn.microsoft.com/library/en-us/gdi/prntspol_62ia.asp

For IBM Point of Sale Subsystem, you can download documentation and examples
from the IBM support website.
http://www2.clearlake.ibm.com/store/support/html/4610-1234.html
 
C

carlospedr

Thand you very much for the Help, I do have some new questions.

I asked about printing a pdf because I had a library that dynamicly
created the a pdf of the document I wanted to print, and that I thought
that it would be much easier to print the pdf than to send ESC
sequences or use the POS API provided to send each element of the
document to the printer.

That being said, I found out, after installing the Windows Drivers
provided by IBM I did not find any reference to printing a document in
landscape mode, the is nothing about that in the API documentation, nor
that option exists when I try to print any document using any windows
program.

I have to print the document in question i Landscape mode because of
it's dimentions.

I've been trying all sorts of strange aproches to do so... but none of
them were sucessfull... I've created pdf files using iTextSharp
component and tried to print them using Acrobat, Acrobat rotates the
document before sending it to the printer (helping me with the
landscape mode setting) but the printer ignores all the text that has
rotation 90º only printing the images of the pdf.

I hope I explained clearly what my problem is.

The question I have is the following, can IBM POS printers in landscape
mode?

(I know this question show be asked directly to IBM, but I have sent an
email 2 days ago and still no answer has arrived.)

C.Pedro
 
C

Christoph Lindemann

I do knot know if the printer is able to print in landscape. If not, it
might not support printing of text in other directions then horizontal.

Alternativly you could "rip" the document to a bitmap, rotate that bitmap in
the directions you like and then send the bitmap to the printer.
 
C

carlospedr

I did think try that but it makes the printing far to slow... I guess
the easiest way to solve the problem is to eliminate it, designing a
new template for the document that can be printed in portrait mode.
 
C

carlospedr

I did think try that but it makes the printing far to slow... I guess
the easiest way to solve the problem is to eliminate it, designing a
new template for the document that can be printed in portrait mode.

Thank you very much for your help, hope I can do the same for you in
the future.

Carlos Pedro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top