views:

56

answers:

3

Hello,

I've written several variations of a program. The purpose of the program is to convert "any file type" to a TIFF image represenation of that file, as if it were being printed using a printer.

I'm currently using a third party printer driver that I send files to, and it outputs a TIFF image. This is nice, but it requires me to use Office Interop files, and interact with each individual processing application in order to print the files.

I had previously tried a toolkit, called Apose .NET, which did not rely on Office Interop, and did not require any printer driver. It did the conversion all on its own and would create a TIFF image. The problem with Aspose .NET was that it did not support a wide variety of input file types. Most notably, it can't do Visio files.

My project calls for the ability to create a TIFF image for virtually "any file type". (excluding exes, music files, and stuff) I know that finding something that handles literally any file type is probably not a very feasible task, so I figure if it can at least handle all the Office file types, Adobe types, and other major standard file types, then I can write a custom extension parsing module that uses those processing applications to do the printing of any file type that can be viewed using those applications.

So, does anyone know of a toolkit that can do this? Preferably one that does not rely on Office or a printer driver. It does not have to be free, or open source. Or, if you know of an amazing printer driver that does this, I'm open to that too.

Thanks in advance, Ryan

+2  A: 

I'd suggest using something like ImageMagick. It handles a variety of source formats.

Your "convert any file type to TIFF" requirement is absurd though.

Converting any image file type to TIFF is fine.

Converting a postscript file to TIFF is fine, though more involved (i.e., something that you can print - set up a postscript printer on your machine and print to file, then convert the .ps to TIFF).

Converting EXEs, MP3s, or other random binary data to TIFF just doesn't make sense (unless you want an TIFF image of a hex dump).

Seth
I don't think even ImageMagick can handle "any image file type". "A lot of image file types" I can believe. ;>
dthorpe
EXEs, MP3s, other binary file types are exlcuded. Won't be trying to print those. As for the any file type requirement, I'm currently most file types by using that printer driver and any API that I can find for interacting with other processing applications - such as Word, Excel, Adobe's programs, etc.ImageMagick only does Image Type to Image Type converstions, for the most part. It won't work for like Word Doc to TIFF.
Ryan
@Ryan - I would assume that writing a printer driver is more difficult than writing a postscript-to-TIFF converter which makes use of ImageMagick. I'm reasonably sure that you could set up a networked "printer" on a unix box which would do it for you automatically too. If I were you I'd probably lobby *real* hard for PDF though.
Seth
Does Adobe's software convert anything to PDF? I've been under the impression that it's capable of converting basically anything to a PDF. If that's the case, I may be able to lobby for a multi-part process that converts everything to PDF, and then a seperate application to run afterwards would convert PDF to TIFF.
Ryan
@Ryan - I suggest PDF because it's far more accessible than TIFFs (i.e., windows ships with Acrobat Reader, Mac OS X has native PDF support). And there are a zillion 'print to pdf' programs out there.
Seth
+1  A: 

This is an integration project - there is no one tool that will read all of the file types you're interested in. In our case, we developed a generic transcoding service that accepts numerous input types (by file extension) and executes external applications based on that type:

We haven't found an application that will interpret Visio files of all versions other than Visio itself. And as you may already know, Office Interop should not be used on a server.

ladenedge
Ah, I see. I did like Aspose.NET, although it seemed much slower than the print driver alternatives. It was all encapsulated in those nice looking APIs, though. I recall it being less customizable, compared to Office Interop, for Excel.I may ask if I can do something similar to what you have said you guys do.
Ryan
Is there a reason you use Ghostscript for PDF over Aspose.NET's PDF output?
Ryan
We supported PDF and PS prior to supporting Office docs, so we simply never had a need to consider Aspose.
ladenedge
A: 
  • FreePDF: print anything to PDF (it uses ghostscript in the background)
  • ImageMagick: convert PDF to TIFF

I used the combination to automatically generate the watermarked images for take-heart.nl.
Those images are PNG, but could just as easily have been TIFF.

--jeroen

Jeroen Pluimers