Tuesday, August 24, 2010

Kill Double Spaces

It's 2010. You're reading this on a computer. You don't write on a typewriter. Likewise, you probably don't write in a fixed-width font (like Courier). If you do use a typewriter-esque, fixed-width font: STOP IT!  They're ugly, archaic and less readable than variable-width fonts. If you use variable width fonts there is no reason, other than habit, to use two spaces after a period. This is actually a fairly controversial issue. A controversy which I have no interest in addressing.

I know what you're thinking. I was taught to use two spaces after each sentence too. It's a difficult habit to break. This macro will help.


Sub Kill_Multiple_Spaces()
'
' Kill_Multiple_Spaces Macro
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = " {2,}"
        .Replacement.Text = " "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Sunday, August 8, 2010

Image PDF to JPG

I recently ran into an issue where opposing counsel sent picture exhibits in PDF format. There are a number of issues with using the PDF format with images - the inability to use image display software for one.

You can extract images from the PDF format using ImageMagick which is excellent for many other image tasks as well (which I may discuss later). The Windows installer can be downloaded here. The down side is that you have to use the old DOS command line (that old black window).

After installing, you can convert PDFs to JPGs by opening the Command window by going to start->run and typing in "cmd" in the open box. Use the CD command (change directory) to open the folder where your image PDFs are. Then, type "mogrify - format jpg *.PDF". All the PDFs in the directory will be converted to JPGs.