Stick on top

For several of my web projects I align myself to one of the common non-written rules of web design: make the top bar a menu bar and keep it on top of the browser screen even when you scroll.

I did so for my personal website lucamauri.com and I recently replicated it with my new project passafrase.it, so I thought about writing a quick post to summarize how to achieve so. Continue reading “Stick on top”

Advertisements

Command a Ghost

Everyone working with graphics in a serious way with a computer should be acquainted with Ghostscritpt. For those who are not, it is a an interpreter suite for PostScript and Portable Document Format: I will not cover it in depth here, but you can learn more at the related Wikipedia article or visiting the official website.
It is a very powerful and versatile tool and one could write books about, but in this post I will focus on one conversion I personally found very useful , but not particularly user-friendly.
So I am publishing this for my own exercise and with the hope of helping other users.

Take the following command:

gswin64c.exe -dNOPAUSE -dBATCH -r600 -sDEVICE=tiff24nc -sCompression=lzw -sOutputFile=scansioni%d.tif scansioni.pdf

comprised of several parts

  • gswin64c.exe
    the executable name: in this case is the 64-bit Windows one.
    You should replace it with the program file appropriate for you OS and architecture
  • -dNOPAUSE
    instruct the parser not to pause and ask for input at the page breaks
  • -dBATCH
    GS will exit at the end of the process instead of entering in interactive loop reading PostScript commands.
    Please note that both -dNOPAUSE and -dBATCH can be replaced by the single -o
  • -r600
    output resolution in DPI. Writing just one value will set vertical and horizontal resolution the same, otherwise you can use the form -rXRESxYRES
  • -sDEVICE=tiff24nc
    the output device, in this case a TIFF file with color depth 24bits
    Other common values could be -sDEVICE=tiffgray or -sDEVICE=jpeg.
  • -sCompression=lzw
    the compression to use for the TIFF file, in this case the Lempel–Ziv–Welch algorithm
  • -sOutputFile=output%d.tif
    the filename of the output: the use of %d will generate one file for each page in the original document appending number to the name output
  • input.pdf
    the original PDF file to read from

this blog post act as a sort of cheat sheet for rapid reference, but complete information on how to use GS can be found at How to use Ghostscript and Details of Ghostscript output devices.