Batch File to Convert Multiple PDFs to TIFF on Windows

Unlike my previous batch files, this one does not require Cygwin or Bash, this makes it more accessible, but slightly less powerful.

This post contains a Windows .bat file that allows a selection of PDFs to be drug onto it. The batch script will convert the PDFs to .tif files. The script below converts the PDFs to 300 DPI multi-page group4 TIFFs. With information from previously posted scripts, it can be easily modified for other output. To run this script it is required to install Ghostscript for windows, and to adjust the command to the correct version (this script used Ghostscript v9.05 on 32-bit Windows. Continue reading

My Favorite Regular Expression Quick Reference

I find This site incredibly useful when working on complex regular expressions (or simple ones doing something I’m not familiar with).

In connection with Notepad++, I frequently use simple regular expressions for converting between Sanction and Trial Director file formats, and for creating clip import-files quickly/converting files provided by other people to be in the format ppp:ll-ppp:ll. Going from a format suck as that, to a fully formatted clip list in Sanction takes a matter of seconds, and getting there from an arbitrarily formatted list is fairly quick too.

Additionally, regular expressions are useful for editing out parts of ASCII depositions (such as time-of-day stamps, or duration lengths from exported designations).

Why TIFF

Aside

A lot of my scripts focus on converting PDF to TIFF. The reason for this is that even though presentation software now pretty much universally supports the PDF format, it has some issues. Most software actually rasterizes the PDF, sometimes this happens in real time on fist viewing. Depending on the computer and PDF the real time conversion can dramatically degrade the display performance (increasing the time until the page the displayed). Additionally the Raster is often at a lower resolution than is actually useful (especially for monochrome images where lack of grays can really damage detail). I therefore ALWAY convert my documents to TIFF except for in the extreme case where I have less than a minute from receipt to display. Additionally, I use single page TIFFs, as first page display can be very slow on large multi-page TIFFs (this is done at the expense of network transfer time). I still use a PDF workflow until this final stage though, as it is far better until the loading into the display software.

Cygwin Saves the Day (again)

A frequent problem I’ve been running into is that LiveNote offers a convenient way to export multiple transcripts, but not in a format that Sanction understand (.pfc). Fortunately this format is simple a bunch of .ptf files connected together (with some redundant header information not duplicated, which can cause a mild annoyance with TrialDirector, but Sanction tolerates it). The solution I’ve found was to run the following command:

csplit ExportedBatch.pcf '/begin=Transcript[^I]/' '{*}';

This will kick out a bunch of files, each being a functional .ptf (except for the first, which is superfluousness header info). To find a specific transcript, open all files in Notepad++ and search all open files for the name or date. Sanction does a pretty good job of reading the meta-data included, so they all can be drug in at once (this saved me from hand exporting hundreds of individual transcripts once).

Useful FOSS Software for Trial Presentation and Preparation

A list of tools that have saved me countless hours, and allowed the completion of the “impossible” more that once. Specifically Avidemux, Audacity, and Super together have had me fix video that others after others have said it was not do-able, or would take too long. This list does not include the scripts that I have written.
Continue reading

A script to name files by Bates number

This script was made because I often would receive PDFs named by their Bates range, or even just the first Bates number of the file, with gaps in numbers between the files. In these cases I wanted to be able to bring the files up in Sanction or Trial Director by typing the bates number, I did NOT want to rename each page document by document.
Continue reading

A Thank You to inData Corporation

inData Corporation has had the courtesy to release their various conversion utilities (DVD Extractor Utility, MPEG Transcoder, MPEG 4 Encoding Utility, and DV-AVI to MPEG-1 and 2 Encoding Utility) as Open Source software under the GPLv2. They perhaps may have been under the impression they had to, though running as a command for mencoder, and ffmpeg being available as LGPL, does not necessitate them to.
Continue reading

A script for monochrome tiffs

This script is pretty much the same as the previous script, but converts everything to monochrome (with the exception of the first page).

It’s a little less cleanly written, and ends up converting the first page twice (it does the whole document in monochrome, then deletes and replaces the first page in color to keep an exhibit label in color), so for many small documents it can be fairly inneficient, though the efficiency of the ghostscript engine, and the ability to run more than one instance at a time more than makes up for it if just a few documents are long.
Continue reading

A basic (very) PDF to Tiff script I’ve developed

Why?

  • Creates a directory structure for ideal adding to Sanction/Trial Director.
  • Files converted to single page tiffs for fastest loading (especially of large documents)
  • This version maintains color (LZW compressed Tiff output), to keep up with modern discovery.
  • Designed to address weaknesses in other solutions (not litigation focused, too slow, single threaded)

Run this script by executing in a directory of PDFs, runs in Cygwin, using ghostscript to convert (a cygwin install of bash, and ghostscript should be the minimum required to run).

Developed because AdultPDF converter did not name files as I desired, could only run a single instance (this script can be run in multiple shells to take advantage of multiple CPUs). It is considerably faster than other solutions to this problem.

Continue reading