Print to multiple printers at once, without opening PrintRequester
- skinkairewalker
- Enthusiast
- Posts: 627
- Joined: Fri Dec 04, 2015 9:26 pm
Print to multiple printers at once, without opening PrintRequester
Hello guys, I have 3 wifi thermal printers, I need them to be just connected to the wifi and receive impressions from a central server without needing any human operator to click OK or display any request that stops the automation process ...
it is possible ?
it is possible ?
Re: Print to multiple printers at once, without opening PrintRequester
Unfortunately, the creation and saving of different printers is still not supported.
We have been wishing for this for a long time.
It should be possible via API. But then everything via API.
We have been wishing for this for a long time.
It should be possible via API. But then everything via API.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 627
- Joined: Fri Dec 04, 2015 9:26 pm
Re: Print to multiple printers at once, without opening PrintRequester
I noticed that the printers are linked to an IP and port 9100, will it be that if I make a request on the IP: 9100 something happens?
Re: Print to multiple printers at once, without opening PrintRequester
What model of thermal printers do you use? On port 9100 sometimes you can simply send the print data...
Re: Print to multiple printers at once, without opening PrintRequester
Port 9100 is the default port for network printers.
You can send and receive print data via this port as if it were a serial printer. So you need to know how to handle the print commands.
You can send and receive print data via this port as if it were a serial printer. So you need to know how to handle the print commands.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 627
- Joined: Fri Dec 04, 2015 9:26 pm
Re: Print to multiple printers at once, without opening PrintRequester
i am using : TANca - TP-650 ( termal ) and Epson L365 ( not termal )
I tested the 2 ways to send commands via ESC but when the Epson printer starts printing, the paper hangs and does not come out alone
Code: Select all
If InitNetwork() = 0
MessageRequester("Error", "Can't initialize the network !", 0)
End
EndIf
Global Close = 0
Port = 9100
ConnectionID = OpenNetworkConnection("192.168.1.5", Port)
If ConnectionID
OpenConsole("")
PrintN("Client connected to server...")
SendNetworkString(ConnectionID, "Hello, this is a test print", #PB_UTF8)
SendNetworkString(ConnectionID, "another line", #PB_UTF8)
SendNetworkString(ConnectionID, Chr(27) + Chr(100), #PB_UTF8)
SendNetworkString(ConnectionID, Chr(27) + #CRLF$ , #PB_UTF8)
CloseNetworkConnection(ConnectionID)
Else
PrintN("Can't find the server (Is it launched ?).")
EndIf
Repeat
Until Close = 1
Code: Select all
If InitNetwork() = 0
MessageRequester("Error", "Can't initialize the network !", 0)
End
EndIf
Global Close = 0
Port = 9100
ConnectionID = OpenNetworkConnection("192.168.1.5", Port)
If ConnectionID
OpenConsole("")
PrintN("Client connected to server...")
For i = 0 To 100
SendNetworkString(ConnectionID, "Hello, this is a test print", #PB_UTF8)
Next i
CloseNetworkConnection(ConnectionID)
Else
PrintN("Can't find the server (Is it launched ?).")
EndIf
Repeat
Until Close = 1
Re: Print to multiple printers at once, without opening PrintRequester
You know that you have to send a FormFeed to go to the next page/end a page
A ForrmFeed is ASCII $0C or PB constant #FF or #FF$
A ForrmFeed is ASCII $0C or PB constant #FF or #FF$
Re: Print to multiple printers at once, without opening PrintRequester
Missing Page Feed ?!
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
- skinkairewalker
- Enthusiast
- Posts: 627
- Joined: Fri Dec 04, 2015 9:26 pm
Re: Print to multiple printers at once, without opening PrintRequester
wow, it worked guys, thank you very much!
but I have another question, how do I send images or pdf to be printed?
but I have another question, how do I send images or pdf to be printed?
Re: Print to multiple printers at once, without opening PrintRequester
This is where it starts to get complicated. This is usually done by the printer drivers and the protocols vary from printer manufacturer to printer manufacturer.
Perhaps it is easier to print with RunProgramm and an external programme. For example, Adobe supports the printing of PDF files with the specification of the printer via parameters.
Otherwise, most printers support the PS (PostScript v6) protocol.
Finally, I have programmed printer drivers in the DOS era to print graphics using ESG sequences. The effort is too great.
Perhaps it is easier to print with RunProgramm and an external programme. For example, Adobe supports the printing of PDF files with the specification of the printer via parameters.
Otherwise, most printers support the PS (PostScript v6) protocol.
Finally, I have programmed printer drivers in the DOS era to print graphics using ESG sequences. The effort is too great.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Print to multiple printers at once, without opening PrintRequester
To print a pdf, give this a try: (replace the ip address with the one of your printer)
It should work with some printers.
It should work with some printers.
Code: Select all
Procedure SendBinaryFile(socket0, filename$)
If FileSize(filename$) <= 0 : ProcedureReturn : EndIf
FileID.i = OpenFile(#PB_Any,filename$)
If FileID.i
*memory = AllocateMemory(FileSize(filename$))
If *memory
ReadData(FileID.i,*memory,FileSize(filename$))
CloseFile(FileID.i)
Else
End
EndIf
EndIf
Delay(1000)
SendComplete.i = SendNetworkData(socket0,*memory,MemorySize(*memory))
While (SendComplete.i < MemorySize(*memory))
SendComplete.i + SendNetworkData(socket0,*memory + SendComplete.i,MemorySize(*memory) - SendComplete.i)
If SendComplete.i >= MemorySize(*memory)
Break
EndIf
Wend
EndProcedure
InitNetwork()
prid= OpenNetworkConnection("192.168.100.1",9100,#PB_Network_TCP, 1000)
Delay(1000)
If prid
SendBinaryFile(prid,"c:\temp\test.pdf")
Delay(1000)
EndIf
Last edited by fluent on Sat May 15, 2021 11:27 pm, edited 1 time in total.
Re: Print to multiple printers at once, without opening PrintRequester
You can use GhostScript to print the file with a specific driver (which works with your printer) to a file.
Then send this file to the printer.
https://www.ghostscript.com/doc/9.25/Devices.htm
Not tested:
Or you can send directly to a network printer:
If it is not running on a server you can use this for free:
http://www.lvbprint.de/html/printmulti1.html
Then send this file to the printer.
https://www.ghostscript.com/doc/9.25/Devices.htm
Not tested:
Code: Select all
gs -sDEVICE=epson -sOutputFile=epson.dat test.pdf
Code: Select all
gsprint -printer "\\ps1\epson" -dPDFFitPage "pdf.pdf"
http://www.lvbprint.de/html/printmulti1.html
- skinkairewalker
- Enthusiast
- Posts: 627
- Joined: Fri Dec 04, 2015 9:26 pm
Re: Print to multiple printers at once, without opening PrintRequester
does it work on thermal prints?infratec wrote: ↑Sat May 15, 2021 9:22 pm You can use GhostScript to print the file with a specific driver (which works with your printer) to a file.
Then send this file to the printer.
https://www.ghostscript.com/doc/9.25/Devices.htm
Not tested:Or you can send directly to a network printer:Code: Select all
gs -sDEVICE=epson -sOutputFile=epson.dat test.pdf
If it is not running on a server you can use this for free:Code: Select all
gsprint -printer "\\ps1\epson" -dPDFFitPage "pdf.pdf"
http://www.lvbprint.de/html/printmulti1.html