How to pass and print files through LPT1 port using thermal printer

hello,
We are developing POS for a retailer store and we most probably finished it. We are using the following hardware interfaces for the development.
1) Receipt Printer with Cash Drawer
Brand: POSIFLEX pp6000 serial thermal printer
Power Rated: DC 24v 2.0 A
Model no: 3902c492
2) Barcode Label Printer
Brand : Monarch Paxar
Model No: M09642PMU
Serial No: 20123152
3) POLE DISPLAY
Brand: CE
Model No: 07010517
4) Barcode Scanner
Brand: KB WEDGE
Model no: A307911
5) Programmable Keyboard
Brand: PREH COMMANDER MC 128
Model No: 90319-000/0000
Serial No: 014693
6) Touch Screen
Brand: 3M TOUCH SYSTEMS INC
Model No: 11-81371-129
The problem is , we never get the printout of the receipt .But we generaed the receipt. And the cash drawer is not opening.We use the following code for printing the receipt
import java.awt.print.*;
import java.io.*;
import java.util.*;
class PrintManager extends Thread
String STR_OUT="";
boolean CD_OPEN=true;
FileOutputStream fos;
PrintStream ps;
//char[] CMD_CUT={29,86,66,250}; //cuts paper
char[] CMD_CD_OPEN={27,112,0,25,250}; //kicks cash drawer 1
public PrintManager(){
setDaemon(true);
public void Init()
Init(true);
public void Init(boolean CDOPEN)
try{
fos = new FileOutputStream("LPT");
System.out.println("nnnnnnnnnnnnafter LPT2");
ps = new PrintStream(fos);
System.out.println("nnnnnnnnnnnnafter LPT2");
// System.setOut(new PrintStream(new FileOutputStream("LPT1.txt")));
//System.setOut(new PrintStream(new FileOutputStream("console.txt")));
System.out.println("SFWERWRW"+ps);
// STR_OUT=STR;
CD_OPEN=CDOPEN;
}catch(Exception ex)
System.out.println("Init:New::"+ex.toString());
public void run ()
try{
if(ps==null)
return;
//ps.println(STR_OUT);
//ps.print(CMD_CUT);
if(CD_OPEN)
System.out.println("ewqeqeqe");
ps.print(CMD_CD_OPEN);
System.out.println("ewqeqeq3453e");
ps.close();
fos.close();
}catch(Exception ex)
System.out.println("run::"+ex.toString());
public void Close()
try{
ps.close();
fos.close();
ps=null;
fos=null;
}catch(Exception ex)
System.out.println("Init:close::"+ex.toString());
public class PrintRcpt {
public static void main(String args[]) {
PrintManager objPM=new PrintManager();
//call Init always before calling start
objPM.Init(); //print and open cashdrawer
//objPM.Init("ZX",false); //print and do not open cashdrawer
objPM.start();
System.out.println("DONE");
//Below sleep is a simulation for time lapse between two sales- do not include this sleep in the final code
try{
Thread.sleep(1000);
System.out.println("DONE2");
}catch(Exception ex){}
//before starting second sale, close the port connection opened by first sales
//this close should be called when the user closes the receipt print preview screen
objPM.Close();
objPM=null;//destroy the print manager object
[/code]
You please post your suggestion for getting the printout from our POS system.

[url http://forum.java.sun.com/thread.jsp?forum=31&thread=535737]Duel posted

Similar Messages

  • How to fetch and save file in common server using FTP in SAP

    Dear All,
    My requirement is to fetch a image and save an image in a common server through SAP .
    I think there is some concept of doing the same using FTP.
    Please put some light on this issue.
    REgards,
    Amruta

    Hi,
    Below are the FM's use to FTP.
    FTP_CONNECT                    Connect to FTP server
    FTP_COMMAND                    Execute FTP Command
    FTP_DISCONNECT                 Disconnect from FTP server
    You can search SDN for more details on each of the FM's.
    Hope this helps
    Regards
    Shiva

  • How to read and write from the serial port using java

    can anyone tel me how to capture data from a serial port and display on the screen and also store it in a database.

    Java Comm API, JDBC

  • How to pass array of Object in A Procedure using OCCI.......

    I m also trying for How to pass Object to a procedureb using OCCI...
    Steps....
    1. I created A type.....
    2. Then I created a VARRAY using that Type.
    3.After that I have written An Procedure with object as a parameter..
    now using OCCI how do u bind the parameter with this . plz note that using OTT
    i have already created the class representation of above object type i.e class
    four Files Created 1> demo.h 2>registermapping.h
    3> demo.cpp 2>registermapping.cpp
    After I want to Pass the Values in A Vector...
    vctor<full_name *> vect;
    stmt=con->createStatement("BEGIN Add_Object(:1); END;");
    full_name *name1 = new full_name; //Giving the Error here Given below....
    name1->
    name1->
    Through name1 Which Function I will call in which I will Pass a String....
    like
    name1->readSQL("Sanjay"); Or I have to add a function......
    vect.push_back(name1);
    setVector(stmt,1,vect,"FULL_NAME");
    error C2259: 'FullName' : cannot instantiate abstract class
    can u plz suggest me Why this Error is Giving......?
    How to pass the data?
    setFirst_name() and setLast_name() this two function I will add in Demo.cpp which one created automativcally by Using OTT command.....or other way plz tell me Boss ....
    Can u lz Suggest me ASAP....

    hi Nishant ,
    What u have done Now I mm trying ....
    can u Plz Suggest me......
    How to pass and Array of Object in Procedure using OCCI... Doing....
    90% finished Two Error's Are Coming...
    1> If I create the Class then Data Not Inserting table......
    2> If I will create the Class through OTT command.......
    then U can't Instantiate Object It is DIsplying ,this is Abstract Class(PObject)...
    Beco'z the below Method is Not adding Automatically by OTT command which is Pure Virtual Function.....
    But I added this Function Still SAme Error Giving..
    getSQLTypeName(oracle::occi::Environment env, void *schName,
    unsigned int &schNameLen, void **typeName,
         unsigned int &typeNameLen) const
    Plz Suggest me....
    regard's
    sanjay

  • How to view and print pdf files

    how to view and print pdf files

    Download and install Adobe Reader: Adobe Reader Install for all versions
    Open the PDF file using it. If security restrictions don't prevent it you could also print it.

  • How to undeploy an .sda file through command line

    Hi,
    How to undeploy an .sda file through command line.send me the related command to do it.and related information and links.

    Hi
    Please find below the steps to undeploy thro command line :
    Shut down the sdm server
    1)SDM shutdown "sdmhome=D:\usr\sap\J2E\JCO1\SDM\program" "sdmguiport=50018" "sdmhostname=<hostname>" password="<password>" "shutdownmode=abort"
    2)sdm jstartup "mode=standalone" "sdmhome=c:\usr\sap\J2E\DVEBMGS00\SDM\program"
    3) sdm undeploy "sdmhome=D:\usr\sap\J2E\DVEBMGS00\SDM\program" "compname=c:\test.sda"
    4)sdm jstartup "mode=integrated" "sdmhome=c:\usr\sap\J2E\DVEBMGS00\SDM\program"
    5)start the sdm server again
    SDM server "sdmhome=D:\usr\sap\J2E\JCO1\SDM\program"
    Hope this helps. do not forget to reward points
    regards
    rajeshkr

  • How to create and print contact sheet using photoshop elements 10?

    how to create and print contact sheet with photoshop 10?

    Which operating system are you using?
    On a windows system you can use the Organizer
    http://www.dummies.com/how-to/content/how-to-print-contact-sheets-in-photoshop-elements-.h tml
    On a Mac, File>Contact Sheet II within the pse 10 editor

  • How to compare two PDF files through PLSQL

    Hi,
    Can any body help that how to compare two PDF files through PLSQL programing and gives the differences as output.
    Thanks,

    Or simply apply an oracle text index on your pdf column:
    SQL>  create table t (id integer primary key, bl blob)
    Table created.
    SQL>  declare
    bf bfile := bfilename('TEMP','b32001.pdf');
    bl blob;
    begin
    dbms_lob.createtemporary(bl,true);
    dbms_lob.open(bf,dbms_lob.lob_readonly);
    DBMS_LOB.LOADFROMFILE(bl, bf,dbms_lob.getlength(bf));
    insert into t values (1,bl);
    commit;
    dbms_lob.close(bf);
    dbms_lob.freetemporary(bl);
    end;
    PL/SQL procedure successfully completed.
    SQL>  create index t_idx on t (bl) indextype is ctxsys.context parameters ('filter ctxsys.auto_filter')
    Index created.
    SQL>  declare
       mklob   clob;
    begin
       ctx_doc.filter ('t_idx', '1', mklob, true);
       dbms_output.put_line (substr (mklob, 1, 250));
       dbms_lob.freetemporary (mklob);
    end;
    Oracle® Database
    Release Notes
    11
    g
    Release 1 (11.1) for Linux
    B32001-04
    November 2007
    This document contains important information that was not included in the
    platform-specific or product-specific documentation
    PL/SQL procedure successfully completed.This generates a text only version of your pdf and standard text comparison methods can be applied ....

  • How do I drag and drop files between computers when using Home Sharing in ITunes?

    How can I drag music files between computers while using Home Sharing? An older version of ITunes had a Home Sharing icon in the column browser near the playlist so it was easy to drag and drop.

    Hello cacalenni,
    Thanks for using the Apple Support Communities. I understand that you wish to learn how to import songs using Home Sharing in the new iTunes. The following resource should assist you in doing so:
    iTunes 12 for Mac: Use Home Sharing to import items from another iTunes library
    http://support.apple.com/kb/PH19614
    Cheers,
    Matt M.

  • How do I save a file to a server using flex and coldfusion?

    How do I save a file to a server using flex and coldfusion?
    On the CF side I might need to use this:
    <cffile action="UPLOAD" filefield="Filedata"
    destination="#expandpath('..\somepath)#"
    nameconflict="overwrite">
    And on the flex side I might need to use something like this:
    var sendVars:URLVariables = new URLVariables();
    sendVars.action = "upload";
    var request:URLRequest = new URLRequest();
    request.data = sendVars;
    request.url = _strUploadScript;
    request.method = URLRequestMethod.POST;
    _refUploadFile = new FileReference();
    _refUploadFile = _arrUploadFiles[_numCurrentUpload].data;
    _refUploadFile.addEventListener(ProgressEvent.PROGRESS,
    onUploadProgress);
    _refUploadFile.addEventListener(Event.COMPLETE,
    onUploadComplete);
    _refUploadFile.addEventListener(IOErrorEvent.IO_ERROR,
    onUploadIoError);
    _refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    onUploadSecurityError);
    _refUploadFile.upload(request, "file", false);
    I just don't know how to put it all together in Coldfusion.

    try this...
    http://cf-creations.co.uk/blog/index.cfm/2008/9/20/Flex--File-Upload-Form--Part-One--Build ing-The-Initial-Form

  • How to read a text file through pl/sql

    How to read a text file through pl/sql

    pl/sql runs inside the database. so your file also should be on the database server file system for you to be able to read.
    check out UTL_FILE package. This is the database package to read/write files on the database server.

  • How to copy and paste file in mavericks

    how to copy and paste file in mavericks?

    Spoombung wrote:
    I actually can't get copy and paste to work in Mavericks!!!
    Is it me, or is there something wrong with it? I can hardly believe this was overlooked....
    Obviously it was not overlooked.
    Select a file, go to the edit menu and choose Copy, open another folder and choose Paste from the edit menu.
    What happened (error messages etc)

  • How To Generate And Print Reports In PDF Format From EBS With The UTF8 Char

    Hi,
    I want to know How To Generate And Print Reports In PDF Format From EBS With The UTF8 Character Set in R12.0.4.
    Regards

    Refer to Note: 239196.1 - PASTA 3.0 Release Information
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=239196.1
    Or, you can use XML Publisher.
    Note: 551591.1 - Need Latest XML Publisher / BI Publisher Patches For R12
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=551591.1

  • VISA: How to get the CSV file through C/C++ code?

    How to get the CSV file through C/C++ code?
    I'm communicating with a USB oscilloscope using VISA.

    Thank you for your reply.
    I am using Apache Commons File Upload. Here is the code where I got the "fi".
         DiskFileUpload fu = new DiskFileUpload();
              fu.setSizeMax(1000000000);
              List fileItems = fu.parseRequest(request);
             Iterator itr = fileItems.iterator();
              FileItem fi = (FileItem)itr.next();
              if(!fi.isFormField())
                File tempFileRef  = new File(fi.getName());
         System.out.println("Field = "+tempFileRef.getAbsolutePath());
         }

  • How to download and upload files in Java?

    Hi, everyone
    How to download and upload files in Java? Do you have some references about this issue or some valuable web link�? Thanks!
    Best Regards,
    Hai.Ren

    This is too vague a question, please be more specific. What protocol would you like to use? HTTP? FTP? Something else?

Maybe you are looking for

  • How to use bookmarks in Pages

    I am working with a very large document in Pages and would like to create bookmarks with headings and text that go under those headings. I am not getting the links to work when I try inserting a bookmark. Can someone explain how to link from one part

  • ERP eCommerce 5.0 Product Catalog

    Hello We will be implimenting eCommerce using ECC 6.0 and current version for eCommerce that is installed is ECO 5.0. Is this the latest one? or shall we be on ECO 7.0 that is released with CRM 7.0? Please confirm. Any information that you could shar

  • How to save image?

    Hi all, I have drawn an Image using Graphics, and then I have drawn some rectangles on it. How can I save that image with drawn rectangles? any idea or link which should I refer?

  • Cant make an exeble jar of a package !

    HI, I have made an application declaring a package 'mypack'. My directory structure is : e: --mypack ----msbase.jar ----mssqlserver.jar ----msutil.jar ----Main.java ----*.java ----*.class I set my classpath as : SET CLASSPATH=".;E:\mypack\msbase.jar;

  • Russian character display troubles

    Hi all My problem is: The DB codepage is 1100 (ISO1). Russian chars come from R/3 side in 1500 (ISO5) codepage and stored as is in a DB. There is no RU language pack installed on BW system. As the result I am able to display this data only through th