Home > Back-end >  Aspose - words to convert the word conversion picture can only be written content, unable to convert
Aspose - words to convert the word conversion picture can only be written content, unable to convert

Time:11-27

1, using aspose - words. The jar to convert the word pictures: if the word content for the pictures, you can convert if word content for images can be converted into normal images (will be converted to the picture of the red X)

2, the code block
` ` `
 
Private static List WordToImg (InputStream InputStream, int pageNum) throws the Exception {
if (! IsLicense ()) {
//unauthorized, let through
//return null;
}
Try {
Document doc=new Document (inputStream);
ImageSaveOptions options=new ImageSaveOptions (SaveFormat. PNG);
Options. SetPrettyFormat (true);
Options. SetUseAntiAliasing (true);
Options. SetUseHighQualityRendering (true);
Int pageCount=doc. GetPageCount ();
If (pageNum!=1 & amp; & PageCount & gt; PageNum) {//generated before pageCount zhang
PageCount=pageNum;
}
List ImageList=new ArrayList<> (a);
For (int I=0; i OutputStream output=new ByteArrayOutputStream ();
Options. SetPageIndex (I);

Doc. Save (output, options);
ImageInputStream ImageInputStream=javax.mail. Imageio. Imageio. CreateImageInputStream (parse (output));
ImageList. Add (javax.mail imageio. Imageio. Read (imageInputStream));
}
Return imageList;
} the catch (Exception e) {
e.printStackTrace();
throw e;
}
}

` ` `

3, there will not be any abnormal, will only come out the picture (the picture of the red X icon), abnormal images,



4, everyone involved can communicate,

CodePudding user response:

Used spire. Doc. Jar to into images, contains the word of the picture turned out, after you said this didn't happen, you use the free version of spire to conversion try look at effect how,

CodePudding user response:

Spire. Doc. Jar can realize turn word pictures, but there is no aspose time-consuming and clarity - good words,

Now and then tries to analyze grab images (realized) in the word, but this scheme has two pieces of risk for the time being: 1. The location of the image which belongs to the word of a page, 2. A page if there are both text and images. What should I do,
  • Related