views:

3466

answers:

8

Do you know how can I deal with this format in the server?
I want to let the user upload the file and then download it as PDF or JPG

Edit:
So far, the only "component" I found is MDI2PDF, and it only have a command line tool, not a real DLL to call.

A: 

We currently use the Amyuni print engine for our server based printing (also our desktop application printing). It is a lot more expensive than the product you are looking at. This behaves like, and is installed like, a printer. QuickBooks also uses this print engine. Our products print government forms with barcodes, so we need something exact like Amyuni, and neither iText nor pdflib are sufficient for our needs.

Tangurena
As far as I can see, this product does not convert a .mdi file. Thanks anyway.
Eduardo Molteni
A: 

If you can't find an API that will do the work, then one possible solution could involve creating a small program that monitors a specific folder for newly uploaded MDI files, performs the conversion (using the tool you linked), then places the resulting jpg file into another folder where it can be downloaded from. A database table could be used to coordinate the state of the job, i.e. whether it's complete, where is the resulting file, etc.

The downside to this approach is the user may not get instant results back, depending on how busy the job is.

tbreffni
I'm not worried about the way the conversion will be done. This could be one solution. But still trying to find a better component to do conversion (guess that does not exists)
Eduardo Molteni
You might be stuck using some sort of Office automation to perform the actual conversion, although that would require a version of Office installed on the server which it seems like you want to avoid.
tbreffni
A: 

This forum thread may provide some insight into how to do it:

http://www.docu-track.com/forum3/viewtopic.php?f=48&t=5637

It looks however like the MDI format is simply a TIFF derivative. You may have more luck trying to convert the .mdi from TIFF format to PDF, instead of searching for/trying to convert .mdi to PDF.

Marineio
The problem here is converting .mdi to something
Eduardo Molteni
However, like I said, the MDI format is simply an adulterated TIFF file. You may be able to open it/convert it with something which supports converting TIFF files to other things, rather than just searching the web for "mdi to something".
Marineio
If you are suggesting than replacing .mdi with .tiff is the solution, it is not. You say that "MDI format is simply an adulterated TIFF file", please tell me a way to convert, in the server, programatically, without office, a .mdi to .tiff and I that will be a starting point.
Eduardo Molteni
A: 

Using Office automation, one can open a lot of various file formats, eg html, word etc, not sure about MDI, but if you can open these in Office (or use Office Automation) all you need to do is print to the generic Microsoft PostScript Printer Driver to create PostScript (PS) file, once you have that you can convert it to PDF using GhostScript.

Mark Redman
Thanks for your input but I want to do the thing in the server (without Office) and programatically.
Eduardo Molteni
Hi, yes I do mean programatically but that means installing Office on the server. A quick search and read indicates this is a proprietary format from micorosft, so unless someone has developed a MDI interpretter.
Mark Redman
A: 

Hi there, Try Installing the PDFConvertor from Http:www.sourceforge.net/projects/pdfcreator, Post which you can invoke the normal print option & choose PDFCreator as the printer on which you want the output. Hope this helps. -- Sridhar Kris.

Thanks for your input but I want to do the thing in the server (without Office) and programatically.
Eduardo Molteni
A: 

Hi; I had a similar problem some time back but I was using tiff files. To generate the pdf I used the .net frameowrk itself to extract page images from a multi pahe tiff file and using itext create a pdf document. Regards Shivam

Shivam
Thanks, but the problem is with MDI files, not TIFF
Eduardo Molteni
+2  A: 

Since the Microsoft Office Document Imaging (MODI) format contains private extensions to the TIFF format, your best bet is to use the Microsoft Office Document Imaging Object Model:

Using the Microsoft Office Document Imaging 2003 Object Model

You don't need a full-blown Office install, just the MODI part. In essesnse, it would be the same as installing any other "component" on the server.

Once installed, you can open the MDI doc, and "SaveAs" as TIFF file, which can then be readily imported into a PDF using a variety of PDF SDKs, or your can convert the TIFF to JPEG or whatever other image format you wish.

GalacticJello
According to Microsoft you can not install only the MODI part without installing Office. I have tried to use only the MODI part that it is located on Program Files\Microsoft\Shared Components but couldn't make it work (It may have other dependencies). Also notice that the server is not mine, I'm just installing a service in a customer server.
Eduardo Molteni
Technically, yes, you have to run the Office install. However, you simply uncheck everything but Microsoft Office Document Imaging.
GalacticJello