Last Modified: December 13, 2001
Drag and drop conversion is available in the wdavince application, the Windows interface to the "DaVince Tools" converters. Files and directories within the application, as well as files and directories from the Windows desktop can be dragged and dropped into the application. Refer to the wdavince documentation for more information on the drag and drop features of this application. This article describes configuring drag and drop for a specific converter without using the wdavince application.
Despite the DOS nature of the DaVince Tools converters, you can drag and drop JPEG, TIFF and text files from the Windows desktop to convert them to PDF. You can also drag and drop directories containing these files. The secret to this is to create a shortcut on the desktop for the appropriate DaVince Tools converter. The procedure for this varies depending on which version of Windows you are using, due to differences in shortcut functionality. The main difference is that Windows 2000 (and hopefully its successors) supports the use of command line options with drag and drop in the shortcut definition. With the other tested Windows flavors, 95/98/NT/ME, command line options in the shortcut definition were ignored when drag and drop was used. With this in mind, the following procedures were developed.
@echo off
c:\dosapps\davince\exe\txt2pdf.exe -p "fixed-80x60" -1 -o .\ %1
%2 %3 %4 %5 %6 %7 %8 %9
pause
Note that file above is 3 lines long, and the txt2pdf.exe line is not entered as two lines. The "-o" option tells the converter to place the PDF files in the current directory, which in fact is the working directory specified in the shortcut. Batch files support up to 9 parameters at a time, so you are limited to dragging up to 9 files and/or directories at a time.
The shortcut will have at least the command line and the working directory fields filled in. The command line will contain the batch file created as outlined above, and the working directory will point to the directory where the newly created PDF files will be placed. This could be a folder on your desktop, where you can easily retrieve the converted files.
You can drag not only single files, but also multiple files or directories into the shortcut. You will either get a single PDF file, or many PDF files in your working directory depending on if the "-1" option is used.
You can drag not only single files, but also multiple files or directories into the shortcut. You will either get a single PDF file, or many PDF files in your working directory depending on if the "-1" option is used.
DaVince Tools was written in C++ using the DaVince Class Library, written by the same author as this program. The DaVince Class Library is a C++ library for developing PDF and TIFF applications. Contact the author at info@davince.com for more information on the availability of the class library.