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. Thi开发者_如何转开发s 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.
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).
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:
- Ghostscript for PDF and PS files,
- ImageMagick for image files,
- Apose.NET for Office types, and
- some homegrown stuff for simpler types like text files.
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.
- 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
精彩评论