当前位置:网站首页>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
边栏推荐
- uni使用的一些坑
- Cross platform packaging of QT packaging program
- Intel SGX preliminary learning and understanding notes (continuously updated)
- QT compressed folder
- What financial products will benefit during May Day?
- js数字大写方法
- 弘玑|数字化时代下,HR如何进行自我变革和组织变革?
- College entrance examination volunteer filling reference
- what is wifi6?
- Create cells through JS (while loop)
猜你喜欢

On the use of constant pointer and pointer constant -- exercise (record)

Differences between sea level anatomy and sea surface height anatomy

Hongji micro classroom | cyclone RPA's "flexible digital employee" actuator

Some pits used by uni

Transposed convolution

OSI层常用协议

弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器
![[untitled] Notepad content writing area](/img/0a/4a3636025c3e0441f45c99e3c67b67.png)
[untitled] Notepad content writing area

Common protocols of OSI layer

C# ,类库
随机推荐
Redis经典面试题总结2022
Pol / select / EPO
Shell instruction learning 1
CMake基础教程(39)pkgconfig
‘EddiesObservations‘ object has no attribute ‘filled‘
STD:: String implements split
Pavlov and hobbies
可执行程序执行流程
Introduction to qqueue
可執行程序執行流程
Map对象 map.get(key)
50 SQL exercises, answers and detailed analysis
Isosceles triangle - the 9th Lanqiao provincial competition - group C
Deconstruction function of ES6
C language - Spoof shutdown applet
Utf8 to STD: string and STD: string to utf8
Breadth first search topics (BFS)
Box collapse and margin collapse
what is wifi6?
数据安全入门产品——数据库审计系统详解