Microsoft Office Document Imaging MODI Printout problem

T

Terence

Hi there,

I'm having a tough time to print .mdi files correctly in my visual
studio.net 2003 c# application. It either
a) skips page 1 if the print job has more than 1 page,
b) print the .mdi file in portrait orientation even when it's showing
as landscape,
c) cut off some contents on the edge of the document, or
4) shrink and print the document to a very small image.

Here's my code:

XmlNodeList xnl =
domObj.DocumentElement.SelectNodes("/PluginXML/FileList/File");
foreach (XmlNode xn in xnl)
{
string strFileName = xn.Attributes["Filename"].InnerXml;
int intNumOfCopies =
Int16.Parse(xn.Attributes["NumOfCopies"].InnerXml);
MODI.DocumentClass doc = new MODI.DocumentClass();
doc.Create(strPrintFolder+strFileName);
if (intNumOfCopies > 0)
{
for (int j=1;j<=intNumOfCopies;j++)
{
doc.PrintOut(1, -1, 1, strPrinterName, "",
false,MODI.MiPRINT_FITMODES.miPRINT_ACTUALSIZE);
}
doc.Close(false);
}
}

I have tried to change the FITMODE to miPRINT_PAGE but it still doesn't
work well on .mdi files with landscape orientation. I have no problem
printing .mdi files with portrait orientation at all. Does anyone has
any idea?

Thanks!
-Terence
 
B

Bob Buckland ?:-\)

Hi Terence,

You may want to post this in the OfficeDev newsgroup using the link below. Generally the MS Office Document Image Writer is a
'print to file' printer to create .MDI files from Office documents.

Be sure to test print the same file manually to see if you get different results.

========
Hi there,

I'm having a tough time to print .mdi files correctly in my visual
studio.net 2003 c# application. It either
a) skips page 1 if the print job has more than 1 page,
b) print the .mdi file in portrait orientation even when it's showing
as landscape,
c) cut off some contents on the edge of the document, or
4) shrink and print the document to a very small image.

Here's my code:

XmlNodeList xnl =
domObj.DocumentElement.SelectNodes("/PluginXML/FileList/File");
foreach (XmlNode xn in xnl)
{
string strFileName = xn.Attributes["Filename"].InnerXml;
int intNumOfCopies =
Int16.Parse(xn.Attributes["NumOfCopies"].InnerXml);
MODI.DocumentClass doc = new MODI.DocumentClass();
doc.Create(strPrintFolder+strFileName);
if (intNumOfCopies > 0)
{
for (int j=1;j<=intNumOfCopies;j++)
{
doc.PrintOut(1, -1, 1, strPrinterName, "",
false,MODI.MiPRINT_FITMODES.miPRINT_ACTUALSIZE);
}
doc.Close(false);
}
}

I have tried to change the FITMODE to miPRINT_PAGE but it still doesn't
work well on .mdi files with landscape orientation. I have no problem
printing .mdi files with portrait orientation at all. Does anyone has
any idea?

Thanks!
-Terence>>
--
Please let us know if this has helped,

Bob Buckland ?:)
MS Office System Products MVP

LINKS
A. Specific newsgroup/discussion group mentioned in this message:
news://msnews.microsoft.com/microsoft.public.officedev
or via browser:
http://microsoft.com/communities/newsgroups/en-us/?dg=microsoft.public.officedev

B. MS Office Community discussion/newsgroups via Web Browser
http://microsoft.com/office/community/en-us/default.mspx
or
Microsoft hosted newsgroups via Outlook Express/newsreader
news://msnews.microsoft.com
 
T

Terence

when i print the .mdi file manually, it also prints portrait and out of
margin. However, it won't skip page 1 and thumbnailed image, which
happen only when i print the .mdi file programmatically. I have
absolutely no idea how to fix it with the MODI.DocumentClass in C#. The
Printout method doesn't really give me any option.

-Terence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top