当前位置:网站首页>Insert picture in freemark
Insert picture in freemark
2022-04-23 05:42:00 【wyazyf】
freemark The picture format in the file is BASE64,
Picture code block in template ,${(img)!} Is a picture variable
<w:pict>
<v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype>
<w:binData w:name="wordml://02000001.jpg" xml:space="preserve">${(img)!}</w:binData>
<v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:69pt;height:62.25pt">
<v:imagedata src="wordml://02000001.jpg" o:title="timg"/>
</v:shape>
</w:pict>
Generate ${(img)!} Picture variables (BASE64 Format )
public String getEmpAutograph(String filePath) {
String img =null;
if(StringUtils.isNotEmpty(filePath)){
InputStream in = null;
byte[] picdata = null;
try {
in = new FileInputStream(filePath);
picdata = new byte[in.available()];
in.read(picdata);
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
BASE64Encoder encoder = new BASE64Encoder();
img = encoder.encode(picdata);
return img;
}else{
return null;
}
}
版权声明
本文为[wyazyf]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230538215293.html
边栏推荐
- [no title] Click the classification jump page to display the details
- What financial products will benefit during May Day?
- 世界与个人发展
- Hongji cyclone RPA provides technical support for Guojin securities and realizes process automation in more than 200 business scenarios
- Deconstruction function of ES6
- 50 SQL exercises, answers and detailed analysis
- Map对象 map.get(key)
- shell指令学习1
- Intel SGX preliminary learning and understanding notes (continuously updated)
- 字符识别easyocr
猜你喜欢
On the use of constant pointer and pointer constant -- exercise (record)
C# ,类库
Flutter nouvelle génération de rendu graphique Impeller
what is wifi6?
Frequently asked interview questions - 2 (computer network)
Intel SGX preliminary learning and understanding notes (continuously updated)
Create cells through JS (while loop)
Use of qwbengneview and qwebchannel.
Differences between sea level anatomy and sea surface height anatomy
The title bar will be pushed to coincide with the status bar
随机推荐
Quick app bottom navigation bar
Range of numbers (dichotomous classic template topic)
Date增加天数
Transposed convolution
XXL job pit guide XXL RPC remoting error (connect timed out)
idea插件---背景播放歌曲
After adding qmenu to qtoolbutton and QPushButton, remove the triangle icon in the lower right corner
What financial products will benefit during May Day?
TypeScript interface & type 粗略理解
弘玑|数字化时代下,HR如何进行自我变革和组织变革?
QSS, qdateedit, qcalendarwidget custom settings
‘EddiesObservations‘ object has no attribute ‘filled‘
Use of qwbengneview and qwebchannel.
Typescript interface & type rough understanding
Deep learning object detection
Executable program execution process
Step on the pit: Nacos uses startup CMD - M standalone startup error
橙单微服务之批量导入
Processus d'exécution du programme exécutable
Frequently asked interview questions - 3 (operating system)