Print PDF files automatically

Discuss RoboTask here
Post Reply
mploug
Posts: 15
Joined: Fri Feb 24, 2017 4:38 pm

Print PDF files automatically

Post by mploug »

Hello,

We have RoboTask 6.7.2.911 running on a Windows server.
We want to create a task that continuously looks for PDF files in a specific folder.
We want the PDF files to be printed automatically to a specific printer.
When the PDF files have been printed we want them to be moved automatically
to another specific folder.

We have to use wildcard (*.pdf) because we don't know the file names.
I think we can use LibreOffice as PDF reader/PDF writer. Is that correct?
Foxit PDF Reader does not support wildcards.

Can we use the action Print Document for the task?
If so, how and where do we tell RoboTask that it should use LibreOffice as PDF reader/PDF writer?

Do we have to use the actions Run Program/Open Document, Print Document and Copy/Move File
in combination to create the task or how can we solve it?

Thank you in advance.

Kind regards,
Martin
Oleg
Site Admin
Posts: 3011
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Print PDF files automatically

Post by Oleg »

I answered similar question. See here: viewtopic.php?p=8664#p8664
You can enumerate files in the loop and print them sequentially file by file
look at my example (see below)
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|2091259954
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task132"
Hide=INTEGER|0
ID=INTEGER|2142044237
LogOnAsUser=INTEGER|1
Name=STRING|"Print PDF by mask"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""folder"" with value ""c:\incoming"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varname=STRING|"folder"
varvalue=STRING|"c:\incoming"

[Actions\Action2]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action2\Params]
createmode=STRING|"1"
date1=STRING|"20211209"
date2=STRING|"20211209"
destvar=STRING|"PDFFILE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{folder}\*.pdf"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""foxitreader.exe /p ""{PDFFile}"""""
Params=FOLDER

[Actions\Action3\Params]
ifnonzero=STRING|"0"
params=STRING|"/p ""{PDFFile}"""
program=STRING|"foxitreader.exe"
runas=STRING|"0"
wait=STRING|"2"

[Actions\Action4]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg Yershov
Post Reply