Print using shared printer in JsPrintSetup - firefox

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

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

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

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.

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.

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.

Microsoft Web Browser ActiveX control - printing to a specified (non default) printer

I'm using the MS Web Browser ActiveX control in a native C++/Win32/MFC dialog application to render some information via HTML.
I'd like to print the contents without any user interaction to the specified printer (which is not the default printer). The printer I'd like to use is a PDF printer.
I'm using a nice wrapper class from Code Project which makes the using the Web Browser control a little easier (http://www.codeproject.com/Articles/3919/Using-the-WebBrowser-control-simplified) and one of the things that wrapper provides is printing. It provides a print method which uses ExecWB(OLECMDID_PRINT,OLECMDEXECOPT_DONTPROMPTUSER,...) to initiate printing of the contents.
This works great and results in the contents of the control being printed to the default printer without any user interaction.
The challenge, then is to have it use a different printer than the default. My initial attempt was to call ::SetDefaultPrinter (http://msdn.microsoft.com/en-us/library/windows/desktop/dd162971(v=vs.85).aspx). This doesn't seem to work. It seems that, despite calling ::SetDefaultPrinter, the web browser ActiveX control still prints to the system default printer. Its as though it ignores whatever this call does.
I tried broadcasting the system settings change message as suggested in the MSDN link as well as directly sending it to the browser window without any luck.
Any ideas how I can get the web browser activex control to print the printer I specify instead of using the default printer?
What I do in addition to all your steps is set the printer in the IE registry, here:
HKCU\Software\Microsoft\Internet Explorer\PageSetup\printer="the required printer name"
And restore everything back after the printing
I got it working. The reason for the problem was NOT that the browser control was printing to the wrong printer, it was that the printing operation (via ExecWB) is performed asynchronously. So, I was setting the default printer to the PDF printer, then initiating the print, then restoring the original default printer. This happened quickly enough that by the time the asynchronous print operation was ready the original default printer was set as the default again and so it went to that printer.
The solution was set the default printer to the PDF printer, initiate the print, then wait for the print completion callback. Once that callback is received, it then restores the original default printer.
If you're using Gary Wheeler's excellent web browser control on Code Project (see here), its very easy to get the print completed callback, you just override the virtual OnPrintTemplateTeardown() method.

Resources