当前位置:网站首页>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
边栏推荐
- QT drawpixmap and DrawImage blur problem
- Pavlov and hobbies
- Mysql 查询使用\G,列转行
- X86 assembly syntax: at & T and Intel
- 五一劳动节期间什么理财产品会有收益?
- Several examples of pointer transfer, parameter transfer, value transfer, etc
- Common protocols of OSI layer
- Hongji | how does HR carry out self change and organizational change in the digital era?
- Simple and basic use of switch and if
- idea插件---背景播放歌曲
猜你喜欢

what is wifi6?

Isosceles triangle - the 9th Lanqiao provincial competition - group C

Arithmetic and logical operations

Flutter 新一代圖形渲染器 Impeller

Generation of straightening body in 3D slicer

Pilotage growth · ingenuity empowerment -- yonmaster developer training and pilotage plan is fully launched

第36期《AtCoder Beginner Contest 248 打比赛总结》

Create process memory management copy_ Mm - processes and threads (IX)

Excel sets row and column colors according to cell contents

Pol / select / EPO
随机推荐
C, class library
Edit, cancel, pull up menu
Hongji micro classroom | cyclone RPA's "flexible digital employee" actuator
Typescript interface & type rough understanding
弘玑|数字化时代下,HR如何进行自我变革和组织变革?
‘EddiesObservations‘ object has no attribute ‘filled‘
Pytorch deep learning practice_ 11 convolutional neural network
Issue 36 summary of atcoder beginer contest 248
Introduction to data security -- detailed explanation of database audit system
windows连接mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)
Markdown syntax support test
QT compressed folder
SQL语句简单优化
橙单微服务之批量导入
No.1.#_6 Navicat快捷键
提升独立站转化率攻略 | 挽回弃购用户
Flutter 新一代图形渲染器 Impeller
Write the declaration of a function to return the reference of the array, and the array contains 10 string objects (notes)
Map object map get(key)
Add two pointers? (legal or illegal)