Hey there,
I am currently testing the PDFPrinter APP we found at the Enfocus Appstore.
The goal is to send incoming files to network printers. Office and Label printers.
The Flow with the app looks like this:
For some printers it works very well for some not, Switch brings up an Error Message that some ScriptExecuter....exe crashed.
Is there any other solution for this use-case.
Sending Printjobs to network printers
Re: Sending Printjobs to network printers
I suggest that you contact the App-creator for support.
https://www.apagoinc.com/
https://www.apagoinc.com/
Re: Sending Printjobs to network printers
I did thanks.jan_suhr wrote: ↑Wed Jul 08, 2020 1:39 pm I suggest that you contact the App-creator for support.
https://www.apagoinc.com/
Benjamin
-
- Member
- Posts: 21
- Joined: Wed Jul 20, 2016 12:03 pm
Re: Sending Printjobs to network printers
An easy alternative if you are operating on windows is a small batch file and Foxit Reader or similar PDF tool :
You need to create the folder "mypath" and use the windows name of your printer. the preset default printing option will be used.
if needed, you can put this batch file in the starting folder
Code: Select all
setlocal enabledelayedexpansion
set mypath=C:\SCRUT\pdfa4
set myprinter=Brother_A4
echo "starting hotfolder scan in %mypath%"
:loop
for %%f in (%mypath%\*.pdf) do (
echo printing %%f
%mypath%\..\PGM\Foxit_Reader.exe /t "%%f" %myprinter%
echo on printer %myprinter%
move "%%f" "%mypath%\ARCHIVES"
echo moving %%f in Archive
)
timeout /t 2
if needed, you can put this batch file in the starting folder
Re: Sending Printjobs to network printers
Benjamin,
a nice and fast option for me was to use gsprint, a part of ghostview, extremely fast and configurable (just change your printer config).
see: http://www.ghostgum.com.au/software/gsview.htm
Switch Setup:
Application: C:/Program Files/Ghostgum/gsview/gsprint.exe
Parameters: -noquery -color -all -printer "MyWindowsPrinter" "%1"
Ralf.
a nice and fast option for me was to use gsprint, a part of ghostview, extremely fast and configurable (just change your printer config).
see: http://www.ghostgum.com.au/software/gsview.htm
Switch Setup:
Application: C:/Program Files/Ghostgum/gsview/gsprint.exe
Parameters: -noquery -color -all -printer "MyWindowsPrinter" "%1"
Ralf.
Re: Sending Printjobs to network printers
Hey Ralf, can you describe that a little further.
Are you starting the gsprint.exe from within Switch?
Thanks Thomas this is so cool. I dont know batch this well, but inspired by your scriptThomasDeschamps wrote: ↑Thu Jul 09, 2020 9:40 am An easy alternative if you are operating on windows is a small batch file and Foxit Reader or similar PDF tool :
...
I wrote myself a python2 script. It works like a hotfolder. PDF-Files need to have the printers name at the end like _BP730i.pdf
The only downside I see is that the scripts open´s the standard APP for PDF Files and sends it to the printer. After that, it closes the APP immediately.
So you won't run this script on your switch server as it would be very disturbing having pdf readers popping up all the time some printjob comes in. :/
Code: Select all
import win32api
import win32print
import os
import time
import shutil
import re
from datetime import datetime
now = datetime.now()
t = now.strftime("%d.%m.%Y, %H:%M:%S")
#all_printers = win32print.EnumPrinters(2)
pdf_dir = "Y:\\HOTFOLDER_DRUCK\\INPUT\\"
archiv = "Y:\\HOTFOLDER_DRUCK\\ARCHIV\\"
while True:
time.sleep(1)
files = os.listdir(pdf_dir)
if files > 0:
time.sleep(6) # WARTEN BIS SWITCH DEN PREFIX ENTFERNT HAT
files = os.listdir(pdf_dir) # ANSCHLIESSEND ORDNER NEU EINLESEN
for f in files:
pattern = re.compile('\_([a-zA-Z0-9]+)\.pdf')
match = pattern.search(f)
printer = match.group(1)
defaultPrinter = win32print.GetDefaultPrinter()
if defaultPrinter != printer:
win32print.SetDefaultPrinter(printer)
print t+" printing file "+ str(pdf_dir+f) +" on "+str(printer) #str(win32print.GetDefaultPrinter())
time.sleep(1)
win32api.ShellExecute(0, "print", os.path.join(pdf_dir,f), None, ".", 0)
time.sleep(6)
shutil.copy(os.path.join(pdf_dir,f),os.path.join(archiv,f))
os.remove(os.path.join(pdf_dir,f))
Benjamin
Re: Sending Printjobs to network printers
What Ralf suggests uses the Execute Command element in Switch.
You'll see when you add it to the flow.
You'll see when you add it to the flow.
Re: Sending Printjobs to network printers
Great thx.
I also found a similar tool to ghostgum its called pdftoprinter http://www.columbia.edu/~em36/pdftoprinter.html.
Sending print jobs to a printer via cmd is easy, there is no pdfreader poping up now its completely silent.
But its also possible to define the amount of copies to print, the printer and the file as variables. But how can I build this in execute command?
My files are named like YB27_bkromer_copies_2_BP730i.pdf and the command should look like
So I need the variable [Job.Name:After="copies_",Before="_"] for the amount of copies, the [Job.Name:After="_",Before=".pdf"] for the printer name and the [Job.Name] for the pdf file to print.
Is there a way to make this work? If this works, this would be the perfect solution.
I also found a similar tool to ghostgum its called pdftoprinter http://www.columbia.edu/~em36/pdftoprinter.html.
Sending print jobs to a printer via cmd is easy, there is no pdfreader poping up now its completely silent.
But its also possible to define the amount of copies to print, the printer and the file as variables. But how can I build this in execute command?
My files are named like YB27_bkromer_copies_2_BP730i.pdf and the command should look like
Code: Select all
c://pdftoprinter.exe c://hotfolder/input/YB27_bkromer_copies_2_BP730i.pdf "BP730i" copies=2
Is there a way to make this work? If this works, this would be the perfect solution.
Benjamin
Re: Sending Printjobs to network printers
You could probably do it with a .BAT or Shellscript file. Use the App Execute Command Friend to create such a file and then let Execute Command run it. With that app you could build up your command with Switch variables.
https://www.enfocus.com/en/appstore/pro ... and-friend
https://www.enfocus.com/en/appstore/pro ... and-friend
Re: Sending Printjobs to network printers
when using gsprint (blazing fast, no size mismatches) you can use all those switches (including copies):
http://www.ccp14.ac.uk/ccp/web-mirrors/ ... sprint.htm
Simple implementation screenshot:
Cheers,
Ralf
http://www.ccp14.ac.uk/ccp/web-mirrors/ ... sprint.htm
Simple implementation screenshot:
Cheers,
Ralf