(Almost) Automatically convert files into PDF

Posted by Ktoso on 16/11/2009 – 01:56

I’m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( http://www.icsr.agh.edu.pl/~mownit/mownit.html ). I was really happy to see some *.ps but some people from my fellow students started complaining that they’d rather have pdf’s and not ghostscript files (who knows why they’d do..?). Anyways, they all had “manual” repetitious methods for converting the files – even uploading to somewebsite to have them converted over there “in the cloud”… I though of a slightly quicker and more efficient way, here it is, hope you’ll like it. Ah, there is One “non standard” requirement for this to work, you have to install cups-pdf :-)

wget http://www.icsr.agh.edu.pl/~mownit/mownit.html -r –level 1 -A.ps –cut-dirs 4
  1. mv www.icsr.agh.edu.pl/* .
  2. rm -rf www.icsr.agh.edu.pl/
  3.  
  4. for file in `dir -f *` ; do
  5.      lpr -P 'cups-PDF' $file;
  6.      echo "press enter when cups is done printing…" #yeah, i got lazy here, one could watch lpq for changes etc.
  7.      read oczekiwanie;
  8.      mv /home/ktoso/Pulpit/cups-pdf/template.pdf ./$file;
  9. done;
  10. # ________________
  11. #< Happy hacking! >
  12. # —————-
  13. #        \   ^__^
  14. #         \  (oo)\_______
  15. #            (__)\       )\/\
  16. #                ||—-w |
  17. #                ||     ||
Tags: , , , , , , , , , , , , , ,
This post is under “coding, freedom, fun, terminal heroes” and has no respond so far.
If you enjoy this article, make sure you subscribe to my RSS Feed.

Post a reply