当前位置:网站首页>freemark中插入图片
freemark中插入图片
2022-04-23 05:38:00 【wyazyf】
freemark文件中的图片格式是BASE64,
模板中的图片代码块,${(img)!}是图片变量
<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>
生成${(img)!}图片变量(BASE64格式)
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://blog.csdn.net/wyazyf/article/details/110420090
边栏推荐
- Solid contract DoS attack
- Note: unordered_ Understanding and use of map
- Escape characters \ splicing of data formats
- C language - Spoof shutdown applet
- 五一劳动节期间什么理财产品会有收益?
- Strategies to improve Facebook's touch rate and interaction rate | intelligent customer service helps you grasp users' hearts
- Shell instruction learning 1
- Differences between auto and decltype inference methods (learning notes)
- deep learning object detection
- Hongji micro classroom | cyclone RPA's "flexible digital employee" actuator
猜你喜欢
Transposed convolution
open3d材质设置参数分析
SQL语句简单优化
Quick app bottom navigation bar
Intel SGX preliminary learning and understanding notes (continuously updated)
Breadth first search topics (BFS)
Some pits used by uni
Create a tabbar component under the components folder, which is public
what is wifi6?
Hongji | how does HR carry out self change and organizational change in the digital era?
随机推荐
Watch depth monitoring mode
Summary of redis classic interview questions 2022
ES6之解构函数
引航成长·匠心赋能——YonMaster开发者培训领航计划全面开启
转置卷积(Transposed Convolution)
refused connection
IPI interrupt
Processus d'exécution du programme exécutable
Frequently asked interview questions - 2 (computer network)
The address value indicated by the pointer and the value of the object indicated by the pointer (learning notes)
Range of numbers (dichotomous classic template topic)
STD:: String implements split
The title bar will be pushed to coincide with the status bar
[the background color changes after clicking a line]
Phlli in a VM node
字符识别easyocr
The role of brackets' [] 'in the parameter writing method in MDN documents
Pavlov and hobbies
Hongji micro classroom | cyclone RPA's "flexible digital employee" actuator
基于ssm 包包商城系统