Forum Samples, Tips and Tricks

Command line tips

I am a beginner in CSS, I come from xlsfo world :-)
It's a real pleasure to work with prince, but I must check really often the result.
So I have done a simple script with autohotkey that make my life easier

#SingleInstance Force

#y:: ; I start the script when windows+y is entered
SetWorkingDir, C:\Program Files (x86)\Prince\engine\bin ; make the next step easier
WinKill book - PDF-XChange Editor ; kill the pdf windows in order to compile. In addition this pdf reader remember by default page and views settings
FileCopy C:\Users\fgi\Downloads\book.html, C:\Users\fgi\Downloads\backup\book_%A_Now%.html ; I make a backup of the current compilation
FileCopy C:\Users\fgi\Downloads\print.css, C:\Users\fgi\Downloads\backup\print_%A_Now%.css

RunWait, prince -s c:\users\fgi\downloads\print.css c:\users\fgi\downloads\book.html -o c:\users\fgi\downloads\book.pdf ; I compile and I wait end of compilation
Run, c:\users\fgi\downloads\book.pdf ; I open the pdf
Thanks for sharing! :D