One Line Script for Converting tiff to pdf files in Linux

Hi folks,

In this post I briefly talk about a one-line script to convert a number of tiff files to pdf files. This can be useful if you scan documents in tiff format and want to save them in pdf format for easy reading. Here it is

Suppose you have a few files 1.tiff, 2.tiff and 3.tiff and need to convert them to 1.pdf, 2.pdf and 3.pdf using the tiff2pdf library, here’s the command to do this on a terminal in Linux:

 

/bin/bash -c 'for i in 1 2 3; do tiff2pdf -o "$i.pdf" "$i.tiff"; done;'

That’s all for now.

Happy software development.

How to Scan Images Remotely

Hi folks,

Today I’ll briefly discuss a nice and easy way to scan images remotely. Suppose you have your multifunction printer or scanner hooked up to an Ubuntu server via a USB cable and you need to quickly scan a document while using a remote machine. How can you go about it? It’s easy. Just use the scanimage command over SSH. There’s an API called SANE (Scanner Access Made Easy) that provides a standard way to access raster image scanners [1]. SANE supports Windows, Linux, UNIX and OS/2. scanimage belongs to the SANE package and is available on Ubuntu by default.

First, log in to the server via SSH.

Next, turn on your printer/scanner and insert the document you wish to scan.

Next, run the following command:

scanimage --format=tiff ><your-file>.tiff

This should fire up your printer/scanner, scan the image and save the result in tiff format. From there you can transfer the output file to your machine for use.

Note that there are alternative ways to achieve this, e.g. by setting up a SANE daemon (saned) on your scanner server and then setting up a SANE client for Ubuntu or using TWAIN for Windows and Mac OS, thus allowing you to use compatible scanner software on the client [2].

Sources

  1. Scanner Access Now Easy – Wikipedia, the free encyclopedia. https://en.wikipedia.org/wiki/Scanner_Access_Now_Easy
  2. SaneDaemonTutorial – Community Help Wiki. https://help.ubuntu.com/community/SaneDaemonTutorial