Drag and Drop Conversion

Part of DaVince Tools
Web Site: www.davince.com

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.

Drag and Drop Configuration in Windows 95/98/NT/ME

A batch file will need to be created for each converter and profile combination you wish to use for drag and drop. The batch file will also need to accept parameters, which will be used to "drop" the files into it. . For example, if you installed DaVince Tools in the "c:\dosapps\davince" directory, the following batch file "txt80x60.bat" can be used to convert text files using the "fixed-80x60" profile:

@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.

Drag and Drop Configuration in Windows 2000

The shortcut will contain the complete command line syntax for the appropriate program without the JPEG, TIFF or text filename. You can have one shortcut for "one to one conversion" and another for "many to one" conversion (version 1.3 of txt2pdf now supports "one to one" conversion). The shortcut should have at least the command line and the working directory fields filled in. The command line will contain the DaVince Tools command and the working directory will point to the directory where the resulting PDF files will reside. The working directory will be where the newly created PDF files are placed. This could be a folder on your desktop, where you can easily retrieve the converted files. For example, if you installed DaVince Tools in the "c:\dosapps\davince" directory, the command line for converting text files using the "fixed-80x60" profile is: c:\dosapps\davince\exe\txt2pdf.exe -p "fixed-80x60" -1 -o .\ Your command line will vary depending on where DaVince Tools is installed. The "-o" option above tells the converter to place the PDF files in the current directory, which in fact is the working directory specified in the shortcut.

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.

About DaVince Tools:

Visit the DaVince Tools web site at http://www.davince.com for the latest version of this software and the latest documentation. DaVince Tools is shareware and software registration is urged if you find these programs useful. You can register the software on-line at http://www.davince.com.

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.