Link-OS SDK print at shared card printer

Tags: 

Hi,

I am currently developing Java program to print card at ZC300 card printer (Link-OS SDK). I need to connect to printer by using shared name as "\\ComputerName\UsbShareName".

I have come accross this article but for C# - https://supportcommunity.zebra.com/s/article/Print-to-a-Shared-Card-Prin... . I need something equivalent to this but in Link-OS sdk.

P.S : I have tried connect using com.zebra.sdk.comm.DriverPrinterConnection but no luck.

Steven Si
For card printer, there is an

For card printer, there is an SDK for card printers in PC-Java. You can check out the documentation at https://techdocs.zebra.com/link-os/2-14/pc_card/. There is a UsbConnection class that can be used to talk to the card printer over the USB. Regarding to "com.zebra.sdk.comm.DriverPrinterConnection", I think is meant for label printers.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Muhammad Ikhbar...
Hi Steven,

Hi Steven,

I have tried to use com.zebra.sdk.comm.TcpConnection, com.zebra.sdk.comm.UsbConnection and com.zebra.sdk.comm.ConnectionBuilder classes but still cannot connect to the printer.

FYI, the printer is installed on the server via IP/TCP, then shared by the server -> i.e. \\192.168.0.20\ZEBRA_CARD

Our program will take the printer name (\\192.168.0.20\ZEBRA_CARD) to establish connection to the card printer. I have done a program to establish connection to printer via printer IP address but this method will make user hard to identify which printer they want to use.

Thanks

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Steven Si
Hi Muhammad,

Hi Muhammad,

There are dev demos that come with the SDK release. They are in the .../link_os_sdk/PC-Card/v2.14.5198/demos fold. The souce code of the demos should show how to connect to the card printer via USB, TCP/IP, etc.

When using the TCP/IP connection, you can refer to the ConnectionBuilder class, which allow you to pass in a DNS name of the printer rather than the IP address. Hope this would make it easier for the users.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Muhammad Ikhbar...
I have tried every class to

I have tried every class to connect to shared printer but the connection could not established.

Can I have more information on how to setup DNS name for the printer? I have setup the DNS name using the printer properties (Zebra application) but cannot connect to printer using DNS name. Is there any setup I need to do anywhere else? F.Y.I there is no DNS server in the network we work on.

Thanks.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Steven Si
I am a bit confused by the

I am a bit confused by the statement of "I have tried every class to connect to shared printer but the connection could not established." If your printer is connected to the network, it should have an IP address. The following statements will create and open a TCP connection.

    Connection conn = new TcpConnection("192.168.1.148", 9100);
    conn.open();

If you cannot get the above work, then I doubt if the printer is truly connected. In terms of DNS name, it's up to the DNS server on your network to assign a DNS name to the printer. We dont't need to do anything on the printer side.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Muhammad Ikhbar...
What I mean is using the

What I mean is using the classes like below

Connection conn = new TcpConnection("\\192.168.0.20\BG_CARD");
conn.open();

But I think there are no class/interface to do this. Thank you so much for your help.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Topic locked