convert the cells in table to images

I have a document with tables in it. I want to convert the each cell present in the table to image.

Any suggestions.......

I, for one, have little idea exactly what you mean by this. What sort of document? What do you mean by convert each cell to an image? Which part of the problem do you not know how to do (read the document, find the table, find the cell, generate the image, something else)?

What has this got to do with Ruby on Rails?

Colin

Colin Law wrote in post #1079401:

Colin Law wrote in post #1079401:

I have a document with tables in it. I want to convert the each cell present in the table to image.

I, for one, have little idea exactly what you mean by this. What sort of document? What do you mean by convert each cell to an image? Which part of the problem do you not know how to do (read the document, find the table, find the cell, generate the image, something else)?

What has this got to do with Ruby on Rails?

Colin

I just have to upload the ms-word document file and click the upload button which should give me the images of the each cell in the table.

how to find the cell and convert to image?

I assume you know how to upload the file (google for rails upload file if not) Then your next problem is not how to find the cell but is how to read the ms word doc in ruby. I don't know, I suggest some googling for that too. I think it will also depend on what type of ms word doc file it is, .doc, docx etc.

You still have not explained what you mean by convert the cell to an image but I think the other problems are more critical.

Colin

Colin

Colin Law wrote in post #1079405:

Colin Law wrote in post #1079405:

What has this got to do with Ruby on Rails?

Colin

I just have to upload the ms-word document file and click the upload button which should give me the images of the each cell in the table.

how to find the cell and convert to image?

I assume you know how to upload the file (google for rails upload file if not) Then your next problem is not how to find the cell but is how to read the ms word doc in ruby. I don't know, I suggest some googling for that too. I think it will also depend on what type of ms word doc file it is, .doc, docx etc.

You still have not explained what you mean by convert the cell to an image but I think the other problems are more critical.

Colin

I have tables in ms-word document(of format doc). I want to convert the data present in each cell either it may be text or image to the image How do you suggest I do it?

As I said the first problem will to find a way of reading the .doc file in ruby, which I don't know how to do. Did google help you with this? Is suggest googling for ruby read .doc

Colin

Colin Law wrote in post #1079407:

Well if you had started this thread by asking how to use the docx gem to find a cell in a ms word document then you would have saved us both some time. I have not used the docx gem so have no idea. Does the documentation for the gem tell you how to parse the document?

Colin

Colin Law wrote in post #1079413:

file in ruby, which I don't know how to do. Did google help you with this? Is suggest googling for ruby read .doc

Colin

I can read doc using the docx gem, my problem is identifying the cell and converting it to image

Well if you had started this thread by asking how to use the docx gem to find a cell in a ms word document then you would have saved us both some time. I have not used the docx gem so have no idea. Does the documentation for the gem tell you how to parse the document?

Colin

Parser object source code:

def initialize(path)   @zip = Zip::ZipFile.open(path)   @xml=Nokogiri::XML(@zip.find_entry('word/document.xml').get_input_stream)

  if block_given?     yield self     @zip.close   end end

I don't understand why you have posted that code. I notice however that the docx gem says that it is for .docx files, not for .doc

Colin

Colin Law wrote in post #1079421:

Colin Law wrote in post #1079421:

  @zip = Zip::ZipFile.open(path)   @xml=Nokogiri::XML(@zip.find_entry('word/document.xml').get_input_stream)

  if block_given?     yield self     @zip.close   end end

I don't understand why you have posted that code. I notice however that the docx gem says that it is for .docx files, not for .doc

Colin

Suggest something other than the googling for finding the table/cell in the document

As I said I have no idea about that gem. I would start by looking at the documentation for the gem.

Colin