Skip to content

msword2image/msword2image-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSWord2Image-Java

This library allows you to quickly convert Microsoft Word documents to image through msword2image.com using Java for free!

Demo

Example conversion: From demo.docx to output.png.

Note that you can try this out by visting msword2image.com and clicking "Want to convert just one?"

Installation

You can simply download MsWordToImageConvert.jar which includes all dependencies.

Usage

1. Convert from Word document URL to JPEG file

MsWordToImageConvert convert = new MsWordToImageConvert(apiUser, apiKey);
convert.fromURL("http://msword2image.com/docs/demo.docx");
convert.toFile("output.jpeg");
// Please make sure output file is writable by your Java process.

2. Convert from Word document URL to base 64 JPEG string

MsWordToImageConvert convert = new MsWordToImageConvert(apiUser, apiKey);
convert.fromURL("http://msword2image.com/docs/demo.docx");
String base64EncodedImage = convert.toBase46EncodedString();

3. Convert from Word file to JPEG file

MsWordToImageConvert convert = new MsWordToImageConvert(apiUser, apiKey);
convert.fromFile("demo.doc");
convert.toFile("output.jpeg");
// Please make sure output file is writable and input file is readable by your Java process.

4. Convert from Word file to base 64 encoded JPEG string

MsWordToImageConvert convert = new MsWordToImageConvert(apiUser, apiKey);
convert.fromFile("demo.doc");
String encodedString = convert.toBase46EncodedString();
// Please make sure input file is readable by your Java process.

5. Convert from Word file to base 64 encoded GIF string

MsWordToImageConvert convert = new MsWordToImageConvert(apiUser, apiKey);
convert.fromFile("demo.doc");
String encodedString = convert.toBase46EncodedString(OutputImageFormat.GIF);
// Please make sure input file is readable by your Java process.

6. Convert from Word file to base 64 encoded PNG string

MsWordToImageConvert convert = new MsWordToImageConvert(apiUser, apiKey);
convert.fromFile("demo.doc");
String encodedString = convert.toBase46EncodedString(OutputImageFormat.PNG);
// Please make sure input file is readable by your Java process.

Supported file formats

Input\Output PNG GIF JPEG
DOC
DOCX

About

Programatically Convert Microsoft Word Documents to Image - Java

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages