Is there a programming toolkit for converting “any file type” to a TIFF image?

偶尔善良 提交于 2020-01-01 16:39:49

问题


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.


回答1:


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.




回答2:


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




回答3:


  • 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



来源:https://stackoverflow.com/questions/2594613/is-there-a-programming-toolkit-for-converting-any-file-type-to-a-tiff-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!