-
Member
[Tutorial] Automatically Convert MDC to Kneeboard Images
At the end of this tutorial you will be able to drop the PDF file from OPsboard into the DCS Kneeboard folder and automatically let it convert to images, which will show up in the in-game Kneeboard.
-----
prerequisites:
I will not go into detail on how to install these programs: the default settings in the installers are OK.
Install ImageMagick: http://www.imagemagick.org/script/bi...es.php#windows (Currently ImageMagick-6.9.2-3-Q16-x64-dll.exe as of writing)
Install GhostScript: http://ghostscript.com/download/gsdnld.html
Install EventGhost: http://www.eventghost.org/downloads/
-----
Start EventGhost and create a new file by pressing File -> New. You are presented with a new EventGhost file. In the menu, go to configuration -> Add Plugin…(Figure A)
FIGURE A
From here scroll all the way down until you find the ‘Directory Watcher’ plugin. The Directory Watcher monitors a directory and generates events if files are created, deleted, or changed. We’ll use this plugin to tell EventGhost when a new file is added to our kneeboard folder.
Select the plugin and click ok. A new window will pop up, asking you what directory the plugin should watch. Click the Icon to the right of the watch path and browse to your DCS kneeboard location ([DCS World Directory]\ Bazar\Terrain\Kneeboard\). Close the window by pressing ok. (Figure B)
FIGURE B
You now have the directory watcher plugin configured to fire events when a file is created (e.g. moved) into your DCS Kneeboard folder.
In EventGhost, on the menu, go to Configuration -> Add Macro… (Figure C)
FIGURE C
In the menu that pops up, expand ‘system’ and select Start Application. A new window will pop up: press OK on to exit both windows. Now, rename the macro by right-clicking "Start Program" (the one with the little gear next to it) to ’MDC creation’ (Figure D)
FIGURE D
We now want the logger to log a ‘created’ event from the Directory Watcher (DW), so we will create a new text document in the Kneeboard folder. Browse to your kneeboard directory ([DCS World Directory]\ Bazar\Terrain\Kneeboard\) Right-click -> New... -> Text Document. (Figure E)
FIGURE E
When you do this you will see that the DW has detected the creation of the Text Document (the last line on the left window pane in EventGhost). Drag the event from the logger into the previously created macro. You have now assigned the event as a trigger to execute the subsequent items inside the macro.
FIGURE F
In the macro, double-click the ‘start program’ item. Inside the window, in the executable field, browse to the ImageMaqick folder (C:\Program Files\ImageMagick-6.8.9-Q16\convert.exe) and select ‘convert.exe’. In the command line options paste the following into the field:
-density 288 -resize 50% -gravity north -crop 90x87% +repage *.pdf __MDC.png
In the working directory field, browse to your Kneeboard folder.
Lastly, check the box that says ‘Wait until application is terminated before proceeding’. Click ok. (Figure G)
Figure G
You should now have the drag and drop functionality to convert the MDC .pdf file into .png images.
------
OPTIONAL
For a total clean experience, we need to automatically delete the dropped .pdf again once converted. To do this create a new text document in the Kneeboard folder. Rename this file to ‘pdfclean.bat’. Right-click the newly created file and click on ‘edit’. (Figure H)
FIGURE H
In Notepad paste this line:
Del *.pdf
This command will delete all PDFs inside the kneeboard folder, so make sure no other PDFs are saved in the folder ever.
Inside EventGhost click Configuration -> Add Action… (Figure I)
Figure I
In the new window, select ‘Start Application’ once more. In the window that pops up, navigate to the pdfclean.bat inside the kneeboard folder. Lastly, check the box that says ‘Wait until application is terminated before proceeding’. (Figure J)
FIGURE J
EventGhost should now process and afterwards delete your PDF file.
DON’T FORGET TO SAVE YOUR EVENTGHOST FILE!!!
-
The Following 2 Users Say Thank You to ZeroMass For This Useful Post:
Ragtop (01Oct15), Tex (01Oct15)
-
ZULU
81st vFS Pilot
Awesome work Zero - Thanks for taking the time to make this!
-
-
Member
Well done, Zero. Thank you!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules