Converting a Microsoft Document Imaging (.mdi) file to PDF (or JPG) in ASP.net
Asked Answered
B

7

7

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.

Brinker answered 1/7, 2009 at 17:58 Comment(0)
V
2

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.

Victoriavictorian answered 29/1, 2010 at 15:54 Comment(3)
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.Brinker
Technically, yes, you have to run the Office install. However, you simply uncheck everything but Microsoft Office Document Imaging.Victoriavictorian
MODI is also deprecated in Office 2010.Tripe
K
0

This may help:

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.word.conversions&tid=f25ae141-70b9-424c-a921-83d817d9267b&cat=&lang=&cr=&sloc=&p=1

Kobayashi answered 8/7, 2009 at 9:37 Comment(1)
Thanks, but I can't install office in the server.Brinker
S
0

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.

Sleeper answered 13/7, 2009 at 17:40 Comment(2)
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)Brinker
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.Sleeper
S
0

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.

Shlomo answered 13/7, 2009 at 18:4 Comment(3)
The problem here is converting .mdi to somethingBrinker
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".Shlomo
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.Brinker
L
0

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.

Lorin answered 24/7, 2009 at 8:21 Comment(2)
Thanks for your input but I want to do the thing in the server (without Office) and programatically.Brinker
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.Lorin
S
0

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.

Subaudition answered 4/9, 2009 at 12:57 Comment(1)
Thanks for your input but I want to do the thing in the server (without Office) and programatically.Brinker
F
0

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

Fluker answered 21/1, 2010 at 18:11 Comment(1)
Thanks, but the problem is with MDI files, not TIFFBrinker

© 2022 - 2024 — McMap. All rights reserved.