Introduction
Several months ago, one of my clients asked me for creating a simple utility for his bulk scanning process. Also he wanted to save the scanned documents into PDF and then burn them on CD/DVD for archiving.
After some research on the Net, I decided to combine various free and open source libraries. Here is list of them:
- PDFLib Lite version. Please read the license carefully. You can use the library for personal usage only, not commercial.
- Nero Burning CD/DVD SDK/API. Please read the license carefully.
- CxImage lmaging toolkit. Thanks to Davide Pizzolato for sharing his knowledge and efforts.
- TWAIN C++ wrapper. Thanks to Rajiv Ramachandran for his article.
Scan2PDF Application
The program is very simple to use. I created a wizard style application that anyone can work with it very easily. Most of the task will be done by program itself and the user only sets the configuration. The above figure shows the first screen of the wizard.
The second screen of wizard asks the user for entering a project name. The application should scan bulk of images, converts scanned images to PDF then burn all PDFs in CD/DVD. However if in middle of scanning/converting process, user decides to leave his desk, what happens. The wizard solves this. Just scan your documents, save them into PDF and whenever you want, you can save your project (going to last page of wizard and click on Finish). After returning, you can open your previous saved projects. The combo box of second page of wizard shows all of projects. See figure 2 for more information.
This is not a tutorial of how to create such kind of this application. But you can take a look at source code and learn by yourself. Also both PDFLib and Nero SDK have an extensive documentation on how to use the libraries. For having some idea of how you can use PDFLib, my other article Text2PDF is another good starting point.
OK, I use CxImage library for creating TIFF files on the fly. You can modify the code to create JPEG files (the PDFLib supports both formats). For scanning purposes, I use the C++ TWAIN wrapper written by Rajiv. Both of articles have good examples of how to employ the code.
Just select your scanner source, click on "Scan New Documents" and after several scans to convert all the scanned documents into PDF, click on "Convert To PDF" button. The progress bar will show progress of converting. After creating the PDF, by clicking on "Scan New Documents" and then "Convert To PDF", you will have separate PDF file.
If you want to know which documents were scanned by you, just click on "Scanned Documents". A dialog will be appear and shows list of PDFs.
Figure 4 shows the next step of wizard. The combo box shows list of available CD Drives including your CD Burner. You have the option for burning the CD or simulate the burning process. If you want to create an image of CD (such as ISO), I have written some code for you, but commented it. You can uncomment the codes and create your own CD image of scanned/PDF documents.
The last step is very simple to use. You have two options. One for launching the wizard again for another wizard and one for deleting the current project (and its PDFs) as shown in Figure 5.
I hope this utility becomes useful for someone and also many people can benefits from it or its source code.
Enjoy!