How to save money by printing with Ghostscript

Quite often, printing a document in full color mode is not only unnecessary, but also a waste of resources.

In order to save ink, time and money, you can simply use the draft mode available in your printer menu. The downside of this method is that you cannot preview your document in draft mode. The preview will always give you a full-color version, regardless of printer settings.

[UPDATE, February 2023: I just discovered this is not accurate anymore, using Windows 10. On Mac OS X, using Apple’s color management system ColorSync with Quartz PDF filters allows you to modify PDF files in a similar way. However, Apple’s documentation on this is minimal. See this page from their official support websites or https://github.com/benwiggy/QuartzFilters for a third-party resource.]

At least for Linux systems you have the option of creating a grayscale version of the document and saving it to a PDF file; however, it will again result in a full-color version, which is unexpected. This makes it necessary to process the PDF file using additional tools so you can get a proper grayscale version of your document.

In this post, you will learn about the tools to help you customize your document so it uses minimal ink, yet is clearly readable and can be checked before you waste paper and ink on a botched print.

To begin with, we will use Ghostscript. Binaries for Linux, Windows and Mac can be downloaded here

Using any shell on Linux, use the following to command to process your file (let’s call it input.pdf for now) and turn it into a new file named result.pdf.

gs -sOutputFile=result.pdf -sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray \
-dNOPAUSE -dBATCH input.pdf

These series of GhostScript commands take your PDF file, convert it to grayscale using a predefined strategy and generate a new PDF file that can be printed as-is. Note that not all command line options I am using here are fully documented by Ghostscript. This initally was what made me write this article: to help others learn about advanced options that are available but hard to find in the Ghostscript tool.

When generating a PDF from a Word document that was created using a version of Microsoft Office 2010 or later, please be aware that some features can cause GhostScript to fail at converting certain or even all document sections.

FPGA bitstream documentation

This article contains a growing collection of resources on FPGA bitstream formats and toolchain details as I find out more about the various vendor’s implementations. It is a continuation of the article published on my old blog.

Over the past couple of years, many projects have developed open source alternatives for proprietary solutions in the IT industry. One of the last areas of proprietary domination includes reconfigurable computing chips. This technology is becoming more and more important as the advantages of FPGAs over conventional processors in speed and energy efficiency become evident.

Even Microsoft has been testing FPGAs to accelerate their Bing search engine.

While there is a wide range of tools available to program the many flavors of microcontrollers like AVR, PIC and Parallella (which happens to be a completely open design), and to flash BIOS chips, similar capabilities are missing in the open source world for field-programmable gate arrays, or FPGAs.

Tools to develop and compile the necessary VHDL or Verilog code to be run on FPGAs are already available, such as Icarus or GHDL.

In order to use the compiled code with an actual FPGA, each vendor has their own tools:

Xilinx offers the free XSE Webpack, Altera seems to have at least a partly open source tool called STAPL (Standard Test and Programming Language), yet to flash the resulting binary code, further proprietary tools are needed.

Lattice Semiconductor, which offers a board to use with the Raspberry Pi computer, is doing the community a huge favor by providing access to affordable hardware.

urjtag.org supports various bitstream formats as well as JTAG adapters, and is under active development. STAPL, however, is not yet supported by urjtag. For now, binaries and source code for a STAPL compiler and player are available from Altera.

http://datenkrake.org/ddk-fpga/ references information on building a bitstream for Microsemi FPGAs. 

Routing of components on the FPGA chip is a complex task that is performed within the proprietary toolchains.

There currently are two open source projects that aim to implement route-and-place routines for FPGAs: RapidSmith and VTR (Verilog-to-Routing).

Rather comprehensive information on older Xilinx FPGAs can be found on the Internet Archive, though not on the manufacturer’s site anymore: