How to use lpt2 as the "line printer" in a gw-basic program. The goal is to change the printer port to lpt2 so i can use the "net use" command to redirect the printer output to a network printer. I can redirect lpt1 to the network printer but have to disable the hardware printer in device manager. However, I get the error printer is offline message.
All this is necessary to get data from the old program data files. I plan to reprint, OCR and import into new software.
You can use the emulator PC-BASIC to run your GW-BASIC program, read its data files and connect it to any printer. Point PC-BASIC to the printer by running it from the command line as
pcbasic --lpt1:PRINTER:MyNetworkPrinterName --print-trigger=page
where you replace MyNetworkPrinterName with the name of your printer in the operating system. If you want all output collected in a single print batch, replace --print-trigger=page with --print-trigger=close.
However, you mention that your final aim is to import the data into another program. A better solution, avoiding the error-prone and labour-intensive scanning and OCR step, might be to let PC-BASIC print to a file directly:
pcbasic --lpt1:FILE:MyOutputFile.txt
which will send the print output to a UTF-8 text file.
Related
We have a Windows 10 machine that can print from applications like MS Word. (Print server 2019) However, when we try to send a print job to the printer from another in-house application, the print job gets deleted by the spooler.
You can see the print job in the printer queue on the originating machine, you can see it in the queue on the print server, but then that's where it stops. It does not get to the status of "Printing job ". Instead the job gets deleted then throws an error (ox2) when trying to delete the file that is already gone.
We tried
changing the printer protocol from LPR to RAW
printing directly to the printer instead of through the print server
sharing the printer from the client machine and printing to that
turning on the EMF Spool option
updating the drivers on the client machine and the print server
I am working with MC9500 Motorola handhelds, Zebra RW-420 printers, and the VIP Application. When I go to print a test page it reads the error:
Failed to read 1 byte(0 read)
Troubleshooting:
-I have successfully printed from other RW-420 printers
-Sent the printers that had this error back to Zebra(now they can print via Bluetooth but still show that error)
-Made sure I have the correct COM Ports
-Reset the printers multiple times on the Zebra Setup Utilities
-I have updated the firmware on the printer
-Tried changing the printer language but nothing helps
I have tried searching for this error but I haven't seen anything relevant yet. Please let me know if there is anything I am missing.
There was a different way to change the printer language and a few other configuration settings that needed to be changed beforehand.
I'm testing an HP LaserJet printer with WinCE7, it's a host-based (not PCL) printer.
When it's plugged into the USB port of WinCE, the USBPRN.dll is loaded but PCL.dll is not loaded which is as expected.
I included wordpad in WinCE and tried to print from wordpad, but there is a error message box saying no printer babah. Printer setting dialog box is not displayed.
Then I use CreateFile/WriteFile/CloseHandle APIs and try to send some ASCII string to the LPT1 port.
The return handles are valid but nothing happened on the printer. According to the debug log, I see something wrong inside WriteFile although the return value is valid.
Then I'm stuck.
I have several other options to try:
Use OpenPrinter/StartDocPrinter/WritePrinter API set. But I'm not
sure if they are different from CreateFile/WriteFile/CloseHandle.
Check to see if there's any open sourced driver for the printer in
Linux world, then I can see what's the data & format I should send
to the printer. But I don't know Linux at all. I'm not sure what
part is different from Windows to Linux or what part is same to
different OS.
Anyone can point out any information about how to implement a
host-based printer driver? Just introduction about the architecture
is also welcome. For example, is there anything related to the
device context (DC) or bitmap or anything else.
I'd like to see any comment on which direction I should go.
Thanks,
Fei
How would I send a CPCL or ZPL command to a Zebra printer through an app?
These commands would be similar to ones used in ToolBox.
For example how would I send "! U1 getvar "allcv"" to a printer and get the results.
I am using the Link-OS ios SDK and already have no problems connecting to and printing to the printers.
Did you ever figure this out? It's quite simple in the *nix world. If you send commands to the lp port via cat or some such, the printer will simply read them in. Note that this must be done as root if you don't have permissions set up on the device to allow normal users.
$ sudo cat command_file.txt > /dev/usb/lp0
So, I'm not a C or C++ developer, but the idea is the same in any language. Open the file for writing (probably O_RDWR so you can read back in any response from the printer) and then send commands to the fd returned from open().
You didn't specify an OS so I'll just stick with this *nix answer. That said, it wouldn't be different in Windows, I suppose. You just have to be able to find the right device.
I need some help in building printer driver. The printer connects to system via serial port. I just need to grab the data that application sends to the printer, compress it (its a custom routine) and send it to printer.
I do not have any experience in developing drivers. I have all the tools, SDK, DDK. If someone could point out some link to a sample driver (that could just write to flat file instead of sending to printer) that would be great.
The driver has to run on windows NT.
So basically i am looking for some sample printer driver, the DDK (with the name of winprint) has one but when i compile and link it, it generates dll file instead of sys.
Please not once again that the WDK wont work as this driver would be running on NT.
You should use the Win NT DDK. It would have sample files. Also in Windows NT, the printer driver files are actually .dll files and not .sys files. Printer drivers are a different category of drivers in Win NT and need to be installed using the Add Printer Wizard and in a package form with an INF file.
If you already have the Win NT DDK, you could use the sample TTY driver that is present. I believe this is available in %DDKROOT%\Src\Print\Mini\Txtonly.
This article talks more about some update to this driver - http://support.microsoft.com/kb/289108
Once you are able to install and run this driver, you should be able to see the main code and add in your own code to get the incoming data and stream it to a file.
Hope this helps. If so, +1 :)
You don't need to modify code to get a driver that can write to a flat file.
A Windows printer driver can be connected to a variety of ports. In particular you can create a Local Port that is actually connected to a file. On the printer's Ports tab, click [Add Port] and then select Local Port and click [New Port]. In the 'Enter port name' edit-text control type the path of the file you want to be filled with PDL data. Then every time you print subsequently, the PDL from the driver will be written to the file associated with the new port, overwriting its previous contents.