LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-28-2010, 09:01 AM   #1
dixan
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Rep: Reputation: 0
Post Linux java apps: printing problem


Sir,

Our Company is using a ERP solution in linux platform, now we are facing a problem with remote printing Linux to Linux, Linux to windows and windows to linux

I have an EPSON LX1050 printer setup via parallel port in linux machine .Recently we purchased RTextPrinter driver (Text mode printing for the Java platform)

i can print java app via Linux Local system, windows local system and windows to windows .But Network printing isn't working
The following the java class path of local and network printer setup


Local printing code : it's working

FilePort filePort = new FilePort("/dev/lp0");
TextPrinter printer=PrinterFactory.getPrinter("EPSON-ESCP");

Note: /dev/lp0 Linux local printer


Remote Pronting code: not working

FilePort filePort = new FilePort("\\192.168.10.125\b2b");
TextPrinter printer=PrinterFactory.getPrinter("EPSON-ESCP");


Note: b2b is the name of share printer



They are providing one example code is:


This is a very simple example:

FilePort port=new FilePort("\\\\MyServer\\HPLaserJ"); // name of shared printer in the network

TextPrinter printer=PrinterFactory.getPrinter("HP-PCL"); // get printer supporting HP-PCL command set

// create printing job
JobProperties job= printer.getDefaultJobProperties();
job.landscape=true;
printer.startJob(port,job);

// print BOLD text
prop=printer.getDefaultTextProperties();
prop.bold=true;
printer.printString("This must be BOLD",prop);
printer.newLine();

// print line
printer.printHorizontalLine(5,0,80); // row 5, column 0 to 80

printer.endJob();



I expect favorable replay
 
Old 01-28-2010, 11:34 AM   #2
never say never
Member
 
Registered: Sep 2009
Location: Indiana, USA
Distribution: SLES, SLED, OpenSuse, CentOS, ubuntu 10.10, OpenBSD, FreeBSD
Posts: 195

Rep: Reputation: 37
Don't you need to escape the backslashes?

Quote:
This is a very simple example:

FilePort port=new FilePort("\\\\MyServer\\HPLaserJ"); // name of shared printer in the network

TextPrinter printer=PrinterFactory.getPrinter("HP-PCL"); // get printer supporting HP-PCL command set
So your should be:
Quote:
FilePort filePort = new FilePort("\\\\192.168.10.125\\b2b");
TextPrinter printer=PrinterFactory.getPrinter("EPSON-ESCP");
At least that is what I see at first glance.
 
Old 01-29-2010, 12:12 AM   #3
dixan
LQ Newbie
 
Registered: Oct 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Post after updating the code showing error:

Errcom.java4less.textprinter.exceptions.CouldNotOpenPrinterException: \192.168.10.125\b2b (No such file or directory)

Last edited by dixan; 01-29-2010 at 12:14 AM.
 
Old 05-28-2012, 01:37 AM   #4
haren
LQ Newbie
 
Registered: May 2012
Posts: 1

Rep: Reputation: Disabled
Hi All,

I'm also having the same problem. Did anyone come up with a solution for Network Printing?
Please reply if you have come up wit a solution asap.

Thank you in advance,
Haren
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Secure Java Apps on Linux using MD5 Crypt LXer Syndicated Linux News 0 01-13-2006 05:01 AM
Java printing problem arubin Programming 0 11-13-2005 03:27 AM
Web-based apps: ActiveX/Java:Windows <--> ${???}:GNU/Linux johnMG Programming 3 12-03-2004 08:37 PM
Java printing - problem with large strings Andy@DP Programming 2 08-03-2004 02:23 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 08:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration