News:

Pretty crazy that we're closer to 2030, than we are 2005. Where did the time go!

Main Menu

Create a tiff image of any file type?

Started by warz, April 07, 2010, 01:19:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

warz

I've been writing various revisions of an application that I use at work on a regular basis. The application's purpose is to convert any file type to a tiff image. In other words, create a tiff image of that file.

Originally, I used the Windows Imaging Printer Driver, or whatever it is called. It's the built in Windows printer driver that converts what you print to an image output file. This does tiff, and it was fast. The problem with this was that it was finicky. The application has to run in the background and require no user intervention. The Windows Imaging printer would often error out and I don't think it was able to convert "anything" to an output image.

I looked for toolkit solutions that I could use with C# and that wouldn't require an external printer driver. I found one toolkit, but it didn't support a wide range of file types - lacked Visio, most notably. I believe the lack of file type support is because it doesn't require Office to print, so they're somehow imeplementing their own print rendering methods for each type, or however that works. I didn't find many others that looked professional enough to use.

I went back to the printer driver solution, but this time found a printer driver written for my exact purpose. It can take most any input that I've tried, so far, and converts it to an output image. It still relies on host applications to provide the print feature, but can supposedly be fed raw file data and determine how to render it on it's own. I've tried this and haven't been able to get it to print anything, yet. It just enters and leaves the print spool.

Anyways, I'm just wondering if anyone knows of a toolkit that can essentially do this. I know I could just as easily use Adobe to convert anything to a PDF, but TIFF is a standard we have to follow.
http://www.chyea.org/ - web based markup debugger

rabbit


warz

I've seen that before, and I think it only does mostly image to image converstions. Like png to tiff.
http://www.chyea.org/ - web based markup debugger

Sidoh

I'm pretty sure ImageMagick can do PDF => TIFF:

^_^[@rhubarb][~][1006][Wed Apr 07, 11:48:27]
$ ll WALKING_CATFISH.*
-rw------- 1 mullins under 137K 2010-03-13 00:25 WALKING_CATFISH.pdf

^_^[@rhubarb][~][1007][Wed Apr 07, 11:48:28]
$ convert WALKING_CATFISH.pdf WALKING_CATFISH.tiff; ll WALKING_CATFISH.*
-rw------- 1 mullins under 137K 2010-03-13 00:25 WALKING_CATFISH.pdf
-rw------- 1 mullins under 6.5M 2010-04-07 11:48 WALKING_CATFISH.tiff


I have no clue why I have that file...

warz

^ ugliest console prompt ever lol.

anyways, image magick only works for image file types. not things like word, excel, etc. i may have to mix and match a bunch of crap together.

on a different note, ive found a completely undocumented function in Microsoft's Office Interop dll for Excel in C#. cant even figure out how to properly call it based on the params, and the VB documentation for something similar. =(
http://www.chyea.org/ - web based markup debugger

Sidoh

You said you could "just as easily have Adobe convert everything to PDF".  This is a trivial additional step.

MyndFyre

If you can go to pdf first, you can use ABCpdf from WebSuperGoo to convert a lot of formats to PDF.
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.

warz

Quote from: Sidoh on April 08, 2010, 07:44:41 PM
You said you could "just as easily have Adobe convert everything to PDF".  This is a trivial additional step.

Yea, the step is trivial but include it in a process that involves converting 800GB of files to TIFF. That's going to like double the amount of time it takes. Basically, when I said that, I was just acknowledging the fact that I had already thought about the Everything -> PDF -> TIFF process and dismissed it.

There are plenty of projects that do individual file types to TIFF. I'm just going to have to continue integrating them all into my project. I was just hoping that somebody had possibly done exactly what I'm doing already.
http://www.chyea.org/ - web based markup debugger

Joe

You could just do it the way you're doing it right now and add PDF as the uhoh clause.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Sidoh

Quote from: warz on April 09, 2010, 10:31:28 AM
Quote from: Sidoh on April 08, 2010, 07:44:41 PM
You said you could "just as easily have Adobe convert everything to PDF".  This is a trivial additional step.

Yea, the step is trivial but include it in a process that involves converting 800GB of files to TIFF. That's going to like double the amount of time it takes. Basically, when I said that, I was just acknowledging the fact that I had already thought about the Everything -> PDF -> TIFF process and dismissed it.

There are plenty of projects that do individual file types to TIFF. I'm just going to have to continue integrating them all into my project. I was just hoping that somebody had possibly done exactly what I'm doing already.

Ah.  I guess I didn't understand.

Sorry, then.  Good luck!

nslay

#10

#!/bin/sh

for dir
do
       for img in $dir/*.jpg $dir/*.jpeg $dir/*.png $dir/*.bmp
       do  
               [ ! -f "$img" ] && continue
               tiff=`echo $img | sed 's/\\.[^.]*$/.tiff/'`
               echo "$img -> $tiff"
               convert "$img" "$tiff"
       done
done


./mkeverythingtiff.sh dir1 dir2 dir3 ...

EDIT: Made regex more robust, changed 'break' to 'continue'
An adorable giant isopod!

warz

Yes, that's great for doing image type -> image type conversions. I've had that under control. My main concern was other file types, such and Word and Excel documents -> tiff. I've got those converting to tiff, also, but I was curious if anyone knew of other "all in one" integration tools for this.
http://www.chyea.org/ - web based markup debugger

nslay

Quote from: warz on April 13, 2010, 12:26:31 PM
Yes, that's great for doing image type -> image type conversions. I've had that under control. My main concern was other file types, such and Word and Excel documents -> tiff. I've got those converting to tiff, also, but I was curious if anyone knew of other "all in one" integration tools for this.
ImageMagick can also convert some document formats like pdf or postscript.  Don't use it to convert vector formats to other vector formats though ... it needlessly rasterizes vector images so that you end up with a very large and useless output vector format.

For other formats, basically it boils down to pdf or postscript.  Just print Excel, Word, etc... files to pdf or postscript.
An adorable giant isopod!

Sidoh

Quote from: nslay on April 13, 2010, 05:17:56 PM
Quote from: warz on April 13, 2010, 12:26:31 PM
Yes, that's great for doing image type -> image type conversions. I've had that under control. My main concern was other file types, such and Word and Excel documents -> tiff. I've got those converting to tiff, also, but I was curious if anyone knew of other "all in one" integration tools for this.
ImageMagick can also convert some document formats like pdf or postscript.  Don't use it to convert vector formats to other vector formats though ... it needlessly rasterizes vector images so that you end up with a very large and useless output vector format.

For other formats, basically it boils down to pdf or postscript.  Just print Excel, Word, etc... files to pdf or postscript.

Someone didn't read some of the other posts. ;)

iago