0

I want to convert doc file into images for the preview of doc file on browser, so is there any way to convert doc to images or any open source jar file for it.

I have used aspose jar file for it and it convert doc file to images, but aspose jar file are not open source so i need open source jar files,

I do not want to use an third party tool for preview of doc file like doc.google.com\gview etc..

so is there any way to convert doc file to images or preview of doc file on browser using java ?

please help me out to convert doc file to images.

shriyash Lakhe
  • 607
  • 1
  • 9
  • 21

2 Answers2

0

As stated in a prior asked Question:

"How to display a Word Document in Browser."

There is no way of Rendering a .doc or .docx file simply with a standalone Browser. Besides using a Preview Tool like the one provided by Google or a plugin that supports this.

Example for Google Doc Viewer (read-only):

<iframe src="http://docs.google.com/gview?url=http://remote.url.tld/path/to/document.doc&embedded=true"></iframe>

But for this you need the .doc or .docx file to be available on a Server, that Google can access files at.

Because you said that you want to convert it to images, I guess read-only should be enough. Also converting a .docx file to an image would possibly require some kind of snapshot tool, that opens the file, takes a screenshot and then saves it. The file format itself isn't suited to be an image.

TheRealHypo
  • 607
  • 1
  • 6
  • 15
0

You can use this library : html2canva and try to crop the targeted area from the web preview tool, it's easy to implement and meets your needs :)

azamani
  • 121
  • 1
  • 3