Click here to Skip to main content
15,924,402 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Webmail application Pin
Michael Sync15-Aug-07 23:54
Michael Sync15-Aug-07 23:54 
GeneralRe: Webmail application Pin
sankar.K16-Aug-07 1:09
sankar.K16-Aug-07 1:09 
GeneralRe: Webmail application Pin
Michael Sync16-Aug-07 1:50
Michael Sync16-Aug-07 1:50 
GeneralRe: Webmail application Pin
Michael Sync16-Aug-07 1:53
Michael Sync16-Aug-07 1:53 
GeneralRe: Webmail application Pin
sankar.K16-Aug-07 2:29
sankar.K16-Aug-07 2:29 
AnswerRe: Webmail application Pin
Vasudevan Deepak Kumar16-Aug-07 0:15
Vasudevan Deepak Kumar16-Aug-07 0:15 
GeneralRe: Webmail application Pin
sankar.K16-Aug-07 1:23
sankar.K16-Aug-07 1:23 
QuestionSplitting TIFF pages using MODI in C# and Viewing Thumbnails in Picturebox Pin
mensdrol15-Aug-07 23:06
mensdrol15-Aug-07 23:06 
Hi,

I am trying to preview the individual pages found inside a multipage TIFF file as thumbnails using PictureBoxes on an ASP.NET aspx page.

Microsoft Office Document Imaging 12.0 (MODI) - is the release which came with Office 2007.
What I am trying to do is split a mulit-page TIFF file using MODI into single pages. Once I've got the pages, I want to show the individual page's thumbnail in a PictureBox in an ASP.NET aspx page.

At the same time I want to OCR the individual pages, as I am using the text found inside each page - which is why I am using MODI.

Using MODI to split the TIFF file seems to work fine - and I can OCR each page and count the words, etc.
Here is the code which does that:

MODI.Document objDoc = new MODI.Document();
//strFileName below is a string variable pointing to the file location of a TIFF file
objDoc.Create(strFileName);
objDoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
int nWordCount = 0;
int nPageCount = objDoc.Images.Count;
string strOCR = "";
//Now I cycle through each page (which is an image)
for (int x = 0; x < objDoc.Images.Count; x++)
{
MODI.Image objImage = (MODI.Image)objDoc.Images[x];
//At this point I want to extract the thumbnail property from the objImage using something like this:
//pictureBox1.Image = ConvertToImageFromIPictureDisp( objImage.get_Thumbnail(MODI.MiTHUMBNAIL_SIZE.miTHUMB_SIZE_LARGE));
MODI.Layout objLayout = objImage.Layout;

//to get a specific word, you can get it at an index, for instance word number 5:
//MODI.Word word = (MODI.Word)objLayout.Words[5];

//I want all words
nWordCount += objLayout.Words.Count;
for (int i = 0; i < objLayout.Words.Count; i++)
{
MODI.Word objWord = (MODI.Word)objLayout.Words[i];
strOCR += objWord.Text;
}
}
objDoc.Close(false);


So at this point, you have OCR'ed the entire TIFF file, and the variable strOCR will have your text with which you can do what you want.

The problem I am getting and with which I am trying to find some help, is that in the same piece of code above, I want to add a piece to extract the thumbnail of each image (page).
So inside the for x loop just after MODI.Image objImage = (MODI.Image)objDoc.Images[x];
I want to extract the thumbnail using this piece of code:
objImage.get_Thumbnail(MODI.MiTHUMBNAIL_SIZE.miTHUMB_SIZE_LARGE)

get_Thumbnail returns of type IPictureDisp (add a reference to stdole to access this interface)
A PictureBox's image property is of type System.Drawing.Image

So how do I convert my IPictureDisp to an Image so that I can use it in a PictureBox?

I've tried to use a class (which inherits from System.Windows.Forms.AxHost) with the following method:
public static System.Drawing.Image ConvertIPictureToImage
(stdole.IPictureDisp picture)
{
return (System.Drawing.Image)System.Windows.Forms.AxHost
.GetPictureFromIPictureDisp(picture);

}

but the exception I get is this: Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))

So I am stuck at this point.

Has anybody come across this and do you perhaps know how to resolve this issue?

Cheers
QuestionNeed to add a Sub-Report to a Main Report using Crystal Reports 10 in an ASP.NET Web Application?? Pin
Robin Khera15-Aug-07 22:45
Robin Khera15-Aug-07 22:45 
QuestionRequest From Pin
AnhTin15-Aug-07 22:33
AnhTin15-Aug-07 22:33 
AnswerRe: Request From Pin
Imran Khan Pathan15-Aug-07 23:20
Imran Khan Pathan15-Aug-07 23:20 
GeneralRe: Request From Pin
AnhTin15-Aug-07 23:30
AnhTin15-Aug-07 23:30 
QuestionCache directory Pin
pjackson1815-Aug-07 22:18
pjackson1815-Aug-07 22:18 
QuestionRe: Cache directory Pin
Urs Enzler15-Aug-07 22:54
Urs Enzler15-Aug-07 22:54 
AnswerRe: Cache directory Pin
pjackson1816-Aug-07 19:22
pjackson1816-Aug-07 19:22 
GeneralRe: Cache directory Pin
Urs Enzler16-Aug-07 20:40
Urs Enzler16-Aug-07 20:40 
QuestionAJAX Calender and dropdown list problem Pin
swpnilekh15-Aug-07 22:00
swpnilekh15-Aug-07 22:00 
AnswerRe: AJAX Calender and dropdown list problem Pin
Mark Churchill16-Aug-07 16:44
Mark Churchill16-Aug-07 16:44 
QuestionGridView Edit through codebehind Pin
dhulipudi15-Aug-07 21:42
dhulipudi15-Aug-07 21:42 
QuestionHow to raise events while clicking a datalist item or a particular Row?? Pin
bijeshputhalath15-Aug-07 21:40
bijeshputhalath15-Aug-07 21:40 
AnswerRe: How to raise events while clicking a datalist item or a particular Row?? Pin
Michael Sync15-Aug-07 21:59
Michael Sync15-Aug-07 21:59 
GeneralRe: How to raise events while clicking a datalist item or a particular Row?? Pin
bijeshputhalath15-Aug-07 23:35
bijeshputhalath15-Aug-07 23:35 
GeneralRe: How to raise events while clicking a datalist item or a particular Row?? Pin
Michael Sync15-Aug-07 23:51
Michael Sync15-Aug-07 23:51 
GeneralRe: How to raise events while clicking a datalist item or a particular Row?? Pin
bijeshputhalath16-Aug-07 1:21
bijeshputhalath16-Aug-07 1:21 
GeneralRe: How to raise events while clicking a datalist item or a particular Row?? Pin
Michael Sync16-Aug-07 1:27
Michael Sync16-Aug-07 1:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.