ESC-POS-USB-NET Unable to access printer exception - epson

I have an EPSON fiscal printer (FP 81 II)
I installed its drivers and now I'm able to print test document to the printer and it's ok.
The installed printer is the following
I'm trying to execute the simple code of the library
Printer printer = new Printer("Printer Name");
printer.TestPrinter();
printer.FullPaperCut();
printer.PrintDocument();
in Printer Name i tryed everithing:
TM-T800F
TM-T800F TM-T900F
EPSON USB Controller for TM/BA/EU Printers
But nothing works, I have always the same Exception:
Unable to access printer : ...

From a previous experience I am thinking you may have a whitespace issue in the name. So copy and paste the name of the printer into your script.
Navigate to the "Printer properties" dialog
In the General tab copy the entire name. (note there may be whitespace characters at the end of the printer name so be sure to capture those characters)
Paste the name into your test script.
Test
Good luck.

Related

Trying to make a printer print a hardcopy ysing the command prompt with customized settings

So as the title says im trying to get a printer print something, the main idea is to use it into code (i can initialize a .bat file using python normally) to create a list of documents i need to print together with all different settings (black and white, recto verso) and all different file locations repeatetly
So far i couldnt even make the printer print a single document except for a test file using prnqctl.vbs
Ive found print /d:"device name" [path]
but i always get the error
"unable to initialize device [device name]"
As i said im able to print a test file with prnqctl.vbs so the printer is working, im on windows 10, thanks in advance

Zebra printer prints zpl code instead of label

Zebra printer is connected to CUPS server and I am sending prints using IPP. When I parse zpl file and fill data using a parser it prints correctly, but when I directly try to print zpl with data using IPP it just prints it as plaintext.
Yeah, I was able to solve the issue. The problem was that the printer was not set to accept the raw zpl and print it. I had to set the printer to raw and it worked. Thanks.
If anyone still facing this issue here are the steps we followed to setup the ZPL printer.
Start the cups server and access the web interface via http://localhost:631/
Add printer
Choose your local printer (your printer should be listed)
press continue
Provide name, description and enable the share checkbox
continue
Choose the Make as 'RAW' please refer to the attached snapshot.
Add the printer.
It should print the label instead of raw ZPL.
Make sure you are using a generic text based print driver to print the ZPL.

Print using shared printer in JsPrintSetup

I am using firefox jsPrintSetup extension to print a iframe silently. It works well when the printer is directly connected to the PC. When I tried to print it on a shared printer am getting an error 'Selected printer is not available'.
How can I specify an shared printer in jsPrintSetup?
Finally this worked!
Made the shared printer as default printer in the system
Get the list of printers connected to the system using js
Pass the first value of the response array to the jsPrintSetup printer function

Return printer queue name (description) using lpstat - OS X

Okay, in short, I'm trying to return a printer list from my system to determine whether a specific printer is present and, if not, automatically setup that printer. Using the lpstat command, specifically:
lpstat -a | awk '{print $1}'
I can get a list returned but the printer names do not match my queue names, which is what I really need. my question is whether there is a way to return the queue names rather than the actual printer name? I'm running this as a shell script in AppleScript on OS X.
When I run the command, I'm getting a printer name returned as "EPSON_TM_T88V" rather than my printer queue name of "Printer 1"
Last time I looked into this, Apple used the Cups printer system, that should be installed on your system.
First you should execute cupsctl WebInterface=yes in a terminal window (you will be prompted for the administrator password.
Then you can try to visit the address (http://localhost:631/printers/?) this is a page you should be able to curl output from, so that you can extract the printer name from the queue name.
And this works for me, visually, maybe you have set up printersharing and the like as well.
A second solution I know of that may help, is that Stefan Klieme, has written a faceless application that listens for Bonjour Events named (Bonjour Events) that you should be able to download, and when you have, you should drop the app onto the library window of AppleScript Editor to see the dictionary. I think however for the Bonjour Events to work, your printer must be up and running, whereas the Cups approach works when the printer is offline.
What I sadly can't remember, is if I set up Cups myself, or if it sets up itself, by interfacing with the Printer Settings in the Systems Preferences panel.
However, I hope this helps.

How to bypass media selection command to printer when using Ghostscript rip ps files?

I am trying to use GhostScript to rip PostScript files first on computer and then forward them to a ricoh MP1350 printer through USB connection, but failed. So I hereby ask for help. The detail is as following.
Followed the instructions provided on www.stat.tamu.edu/~henrik/GSPSPrinter/GSPSprinter.html, I succeeded in building a virtual PS printer on a PC with Win7.
I setup the virtual PS printer with MP1350 PS driver, creating the redirect port RPT1 with argument told by the instruction and in help with RedMon, all printing data were forwarded to the real MP1350 device connected with the PC through USB.
It DOES work when dealing with common printing jobs. However, when I send PostScript files containing MP1350's media selection commands, it seems fail to tell the printer to fetch paper in tray 2 or 3 or 4 as told in that PS file. All pieces of paper are fetched in tray 1.
The print command is:
copy /b sample.ps \\127.0.0.1\gspspr
in which "gspspr" is the printer name of the virtual PS printer, with MP1350 PS driver Ver3.1(latest) installed. "sample.ps" is the postscript file I mentioned above.
The arguments file "mswinpr2.txt" is written as follow:
-Ic:\gs\gs9.05\lib
-sDEVICE=mswinpr2
-dNoCancel
-dNOPAUSE
-dSAFER
-dMaxBitmap=400000000
-dBufferSpace=400000000
-dNumRenderingThreads=2
-dMaxPatternBitmap=80000000
-sPAPERSIZE=a4
With the same PostScript file "sample.ps", if I send it using this command:
copy /b sample.ps \\127.0.0.1\gsprinter
in which "gsprinter" is the name of real MP1350 connected through USB, with MP1350 PS driver Ver3.1(latest) installed. The printer MP1350 can tell those media selection commands and fetch paper from tray 2 or 3 or 4 as told.
All the driver settings of these two devices are the same, and I set output protocol to "TBCP" in "Device Settings" tab.
So please help me to tell, why the printer fails to select the certain media trays when I use gs to rip that ps file? And how to solve it?
With great appreciation!
The PostScript file contains the media and tray selection command,s if you send the PostScript to the printer directly, then those commands are acted upon by the printer.
When you use Ghostscript, you are actually rendering the PostScript to a bitmap, which the mswinpr2 device forwards to the windows printing system. The final printer can be anything, it need not be a PostScript printer. However you can't embed tray selection commands in the bitmap, so there is no way to preserve that request form the original job.
There is no way to 'solve' this, its in the nature of the process.
Given that your printer clearly accepts PostScript directly why are you even using Ghostscript at all ?
If your printer understands PCL5 or PCL6, you can rip your files through ghostscript and have ghostscript mapping the postscript MediaPosition to trays in HP-like printers.
Two of the ghostscript drivers - ljet4 (or one of the pcl5? ones) and pxlcolor,
can map postscript mediaposition to HP media trays. See also discussion on the InputAttributes dictionary and the -dNOMEDIAATRS switch, however. http://bugs.ghostscript.com/show_bug.cgi?id=693053

Resources