In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "word insert html conversion into docx picture does not show how to solve the problem", in the daily operation, I believe that many people in word insert html conversion into docx picture does not show how to solve the problem, Xiaobian consulted all kinds of information, sorted out a simple and easy to use method of operation, hope to answer the "word insert html into docx picture does not show how to solve the problem" of doubt. Next, please follow the editor to study!
Scene description
Use mht format to use freemark to dynamically input pictures on the web page into mht, and convert them to docx format. Among them, the picture is displayed using the vshape tag (found on the Internet), and the picture is converted into base64 and written into the mht file (the specific operation can be done by Baidu itself). Because the java language is used, the tool aspose is used to convert to docx. As a result, the converted docx image is not displayed (it is not that it is not displayed, but there is no place for the picture at all), but the picture is visible when you open the mht file using office word.
As soon as I got hot in my mind, I opened the mht file with wps and found that the picture did not show up! Open it with office word and you can see the picture. Therefore, it is a problem to guess that there is no picture display in docx converted by aspose and wps, which results in that the picture converted out of docx is not displayed.
Analysis of problems
Basically, positioning must be a problem with the label used in the picture display. After searching the Internet, I found that vshape seems to be supported only by office word, so we have to change the display mode.
What shall I do? Wps does not support vshape, so how does it display pictures on a single web page?
Using wps, create a new word, insert a picture, and save as a single web file (mht). Then use notepad++ to open it and find that it is displayed using the img tag. Open it with office word and the picture can be displayed. Finally, use the aspose tool to convert, the converted docx image has been successfully displayed.
Problem solved!
To sum up: the display of pictures in doc may be the use of vml's vshape tag for picture display, but vml is only supported by office, so you can't see pictures using wps and other software, and the tool format conversion will lead to the loss of pictures.
Solution
Display using img tags.
Where ~ tmp {d2189b58-14f4-487b-a11a-94360551a999} 9768886.files/~tmp {d2189b58-14f4-487b-a11a-94360551a999} 97688860.png is the location of the base64 that defines the current image, the Content-Location attribute, and removes the previous user path.
Use notepad++ to open a word (mht format) file with the definition of the current file at the beginning:
-= _ NextPart_000_0076_01C29953.BE473C30Content-Type: text/html; Content-Transfer-Encoding: quoted-printableContent-Location: file:///C:/Users/xxx/AppData/Local/Temp/~tmp{d2189b58-14f4-487b-a11a-94360551a999}9768886.TMP.html
Where ~ tmp {d2189b58-14f4-487b-a11a-94360551a999} 9768886 is equivalent to the id of the current file, so find the base64 definition of the image next.
The following example is the beginning of the base64 definition of an image:
-= _ NextPart_000_0076_01C29953.BE473C30Content-Type: application/octet-stream;Content-Transfer-Encoding: base64Content-Location: file:///C:/Users/xxx/AppData/Local/Temp/~tmp{d2189b58-14f4-487b-a11a-94360551a999}9768886.files/~tmp{d2189b58-14f4-487b-a11a-94360551a999}97688860.png
Intercepting a string starting with ~ tmp {d2189b58-14f4-487b-a11a-94360551a999} 9768886 in Content-Location is the address of src in img.
At this point, on the "word insert html conversion into docx pictures do not show how to solve the problem" on the end of the study, I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.