HTML2PDF with RoboTask

Discuss RoboTask here
Post Reply
eha
Posts: 1
Joined: Sat Sep 12, 2015 11:40 am

HTML2PDF with RoboTask

Post by eha »

Hi,

I have about 10'000 htm(l) files and I'd like to convert all of them to pdf. As this doesn't make fun, I found RoboTask, so perhaps you can help me finding a solution.

My plan is the following:
- I put all html files into a certain folder and start the RoboTask-Task ;)
- It shall open the html file with Google Chrome, execute the following keystroke (in order to print the document):
1. STRG + P
2. ENTER
3. ENTER

I already fail in the point to open files automatically with a certain file extension (.htm).

Can you help me?

OS = Windows 7
Google Chrome Version 45.0.2454.85 m

Thanks!
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: HTML2PDF with RoboTask

Post by Oleg »

Look at the example below
Pay attention that Chrome must be a default browser and default application for HTML files.
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|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task102"
Hide=INTEGER|0
ID=INTEGER|2038905681
LogOnAsUser=INTEGER|1
Name=STRING|"Print HTML files to PDF"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

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

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

[Actions\Action1\Params]
createmode=STRING|"1"
date1=STRING|"20150916"
date2=STRING|"20150916"
destvar=STRING|"FILE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"d:\incoming\*.html"
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|"1"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""{file} """
Params=FOLDER

[Actions\Action2\Params]
ifnonzero=STRING|"0"
program=STRING|"{file}"
runas=STRING|"0"
wait=STRING|"0"

[Actions\Action3]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2 sec"
Params=FOLDER

[Actions\Action3\Params]
delay=STRING|"2"
dimension=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER

[Actions\Action4\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"0"
keylayout=STRING|"0"
keys=STRING|"""^(P){DELAY 500}{Enter}{DELAY 500}{Enter}{DELAY 500}%({F4})"""
pause=STRING|"20"
release=STRING|"0"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"

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