【Freemarker】java代码wps word带图片动态模板生成
生活随笔
收集整理的這篇文章主要介紹了
【Freemarker】java代码wps word带图片动态模板生成
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、 新建word模板
先通過wps或word等文字處理工具新建一個想要的結構的word文檔,數據都先用假數據填充好,填充的數據實際使用上是沒用的,是為了咱們修改模板能夠迅速定位到需要動態填充區域的。
二、 java代碼填充數據
普通的模板填充一般都是字符串填充,帶有圖片的動態word模板,其實也就是在代碼中把圖片文件轉成base64編碼字符了。
for (int i = 0; i < fileList.length; i++) {HashMap<String, Object> file = new HashMap<>();String path = fileList[i].getAbsolutePath();File imageFile=new File(downloadPath+"\\upload\\"+path);try {// 獲取圖片長寬BufferedImage bufferedImage = ImageIO.read(imageFile);double width = bufferedImage.getWidth()*widthProportion;double height = bufferedImage.getHeight()*heightProportion;file.put("width",width);file.put("height",height);} catch (IOException e) {e.printStackTrace();}try {// 寫入wps中的圖片 此處是二進制數據 圖片base64 codefile.put("data", ImgUtil.readImgBase64(path));} catch (IOException e) {e.printStackTrace();}// 必須在word模板中加入 兩個標簽 圖片name才能生效if (imgFile != null && imgFile.exists()) {file.put("name", imgFile.getName());imgList.add(file);} } stringListMap.put("imgList", imgList);三、 free marker模板處理
1. 通過wps等文字編輯工具對模板進行另存為其他格式,選擇xml格式2. 把這個xml文件的后綴改為ftl注意事項: 圖片填充,經過實踐得真知—圖片外側所包的wps標簽需要設置上兩個name才能顯示出來圖片(圖片大小也可以動態調控,在圖片標簽的style屬性里面設置即可)。模板比較長:最主要的是下圖標記的地方
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?mso-application progid="Word.Document"?> <w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml"xmlns:w10="urn:schemas-microsoft-com:office:word"xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core"xmlns:aml="http://schemas.microsoft.com/aml/2001/core"xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint"xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Author>LLJ</o:Author><o:LastAuthor>WDAGUtilityAccount</o:LastAuthor><o:Revision>1</o:Revision><o:Created>2020-09-14T08:06:00Z</o:Created><o:LastSaved>2020-09-14T08:51:49Z</o:LastSaved><o:TotalTime>2880</o:TotalTime><o:Pages>1</o:Pages><o:Words>0</o:Words><o:Characters>0</o:Characters><o:Lines>0</o:Lines><o:Paragraphs>0</o:Paragraphs><o:CharactersWithSpaces>0</o:CharactersWithSpaces><o:Version>14</o:Version></o:DocumentProperties><o:CustomDocumentProperties><o:KSOProductBuildVer dt:dt="string">2052-11.1.0.9584</o:KSOProductBuildVer></o:CustomDocumentProperties><w:fonts><w:defaultFonts w:ascii="Times New Roman" w:fareast="宋體" w:h-ansi="Times New Roman" w:cs="Times New Roman"/><w:font w:name="Times New Roman"><w:panose-1 w:val="02020603050405020304"/><w:charset w:val="00"/><w:family w:val="Auto"/><w:pitch w:val="Default"/><w:sig w:usb-0="E0002EFF" w:usb-1="C000785B" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="400001FF"w:csb-1="FFFF0000"/></w:font><w:font w:name="宋體"><w:panose-1 w:val="02010600030101010101"/><w:charset w:val="86"/><w:family w:val="Auto"/><w:pitch w:val="Default"/><w:sig w:usb-0="00000003" w:usb-1="288F0000" w:usb-2="00000006" w:usb-3="00000000" w:csb-0="00040001"w:csb-1="00000000"/></w:font><w:font w:name="Wingdings"><w:panose-1 w:val="05000000000000000000"/><w:charset w:val="02"/><w:family w:val="Auto"/><w:pitch w:val="Default"/><w:sig w:usb-0="00000000" w:usb-1="00000000" w:usb-2="00000000" w:usb-3="00000000" w:csb-0="80000000"w:csb-1="00000000"/></w:font><w:font w:name="Arial"><w:panose-1 w:val="020B0604020202020204"/><w:charset w:val="01"/><w:family w:val="SWiss"/><w:pitch w:val="Default"/><w:sig w:usb-0="E0002EFF" w:usb-1="C000785B" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="400001FF"w:csb-1="FFFF0000"/></w:font><w:font w:name="黑體"><w:altName w:val="宋體"/><w:panose-1 w:val="02010609060101010101"/><w:charset w:val="86"/><w:family w:val="Auto"/><w:pitch w:val="Default"/><w:sig w:usb-0="800002BF" w:usb-1="38CF7CFA" w:usb-2="00000016" w:usb-3="00000000" w:csb-0="00040001"w:csb-1="00000000"/></w:font><w:font w:name="Courier New"><w:panose-1 w:val="02070309020205020404"/><w:charset w:val="01"/><w:family w:val="Modern"/><w:pitch w:val="Default"/><w:sig w:usb-0="E0002EFF" w:usb-1="C0007843" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="400001FF"w:csb-1="FFFF0000"/></w:font><w:font w:name="Symbol"><w:panose-1 w:val="05050102010706020507"/><w:charset w:val="02"/><w:family w:val="Roman"/><w:pitch w:val="Default"/><w:sig w:usb-0="00000000" w:usb-1="00000000" w:usb-2="00000000" w:usb-3="00000000" w:csb-0="80000000"w:csb-1="00000000"/></w:font><w:font w:name="Calibri"><w:panose-1 w:val="020F0502020204030204"/><w:charset w:val="00"/><w:family w:val="SWiss"/><w:pitch w:val="Default"/><w:sig w:usb-0="E4002EFF" w:usb-1="C000247B" w:usb-2="00000009" w:usb-3="00000000" w:csb-0="200001FF"w:csb-1="00000000"/></w:font></w:fonts><w:lists><w:listDef w:listDefId="0"><w:plt w:val="SingleLevel"/><w:lvl w:ilvl="0"><w:start w:val="1"/><w:lvlText w:val="%1."/><w:lvlJc w:val="left"/><w:pPr><w:tabs><w:tab w:val="left" w:pos="312"/></w:tabs></w:pPr></w:lvl></w:listDef><w:list w:ilfo="1"><w:ilst w:val="0"/></w:list></w:lists><w:styles><w:latentStyles w:defLockedState="off" w:latentStyleCount="260"><w:lsdException w:name="Normal"/><w:lsdException w:name="heading 1"/><w:lsdException w:name="heading 2"/><w:lsdException w:name="heading 3"/><w:lsdException w:name="heading 4"/><w:lsdException w:name="heading 5"/><w:lsdException w:name="heading 6"/><w:lsdException w:name="heading 7"/><w:lsdException w:name="heading 8"/><w:lsdException w:name="heading 9"/><w:lsdException w:name="index 1"/><w:lsdException w:name="index 2"/><w:lsdException w:name="index 3"/><w:lsdException w:name="index 4"/><w:lsdException w:name="index 5"/><w:lsdException w:name="index 6"/><w:lsdException w:name="index 7"/><w:lsdException w:name="index 8"/><w:lsdException w:name="index 9"/><w:lsdException w:name="toc 1"/><w:lsdException w:name="toc 2"/><w:lsdException w:name="toc 3"/><w:lsdException w:name="toc 4"/><w:lsdException w:name="toc 5"/><w:lsdException w:name="toc 6"/><w:lsdException w:name="toc 7"/><w:lsdException w:name="toc 8"/><w:lsdException w:name="toc 9"/><w:lsdException w:name="Normal Indent"/><w:lsdException w:name="footnote text"/><w:lsdException w:name="annotation text"/><w:lsdException w:name="header"/><w:lsdException w:name="footer"/><w:lsdException w:name="index heading"/><w:lsdException w:name="caption"/><w:lsdException w:name="table of figures"/><w:lsdException w:name="envelope address"/><w:lsdException w:name="envelope return"/><w:lsdException w:name="footnote reference"/><w:lsdException w:name="annotation reference"/><w:lsdException w:name="line number"/><w:lsdException w:name="page number"/><w:lsdException w:name="endnote reference"/><w:lsdException w:name="endnote text"/><w:lsdException w:name="table of authorities"/><w:lsdException w:name="macro"/><w:lsdException w:name="toa heading"/><w:lsdException w:name="List"/><w:lsdException w:name="List Bullet"/><w:lsdException w:name="List Number"/><w:lsdException w:name="List 2"/><w:lsdException w:name="List 3"/><w:lsdException w:name="List 4"/><w:lsdException w:name="List 5"/><w:lsdException w:name="List Bullet 2"/><w:lsdException w:name="List Bullet 3"/><w:lsdException w:name="List Bullet 4"/><w:lsdException w:name="List Bullet 5"/><w:lsdException w:name="List Number 2"/><w:lsdException w:name="List Number 3"/><w:lsdException w:name="List Number 4"/><w:lsdException w:name="List Number 5"/><w:lsdException w:name="Title"/><w:lsdException w:name="Closing"/><w:lsdException w:name="Signature"/><w:lsdException w:name="Default Paragraph Font"/><w:lsdException w:name="Body Text"/><w:lsdException w:name="Body Text Indent"/><w:lsdException w:name="List Continue"/><w:lsdException w:name="List Continue 2"/><w:lsdException w:name="List Continue 3"/><w:lsdException w:name="List Continue 4"/><w:lsdException w:name="List Continue 5"/><w:lsdException w:name="Message Header"/><w:lsdException w:name="Subtitle"/><w:lsdException w:name="Salutation"/><w:lsdException w:name="Date"/><w:lsdException w:name="Body Text First Indent"/><w:lsdException w:name="Body Text First Indent 2"/><w:lsdException w:name="Note Heading"/><w:lsdException w:name="Body Text 2"/><w:lsdException w:name="Body Text 3"/><w:lsdException w:name="Body Text Indent 2"/><w:lsdException w:name="Body Text Indent 3"/><w:lsdException w:name="Block Text"/><w:lsdException w:name="Hyperlink"/><w:lsdException w:name="FollowedHyperlink"/><w:lsdException w:name="Strong"/><w:lsdException w:name="Emphasis"/><w:lsdException w:name="Document Map"/><w:lsdException w:name="Plain Text"/><w:lsdException w:name="E-mail Signature"/><w:lsdException w:name="Normal (Web)"/><w:lsdException w:name="HTML Acronym"/><w:lsdException w:name="HTML Address"/><w:lsdException w:name="HTML Cite"/><w:lsdException w:name="HTML Code"/><w:lsdException w:name="HTML Definition"/><w:lsdException w:name="HTML Keyboard"/><w:lsdException w:name="HTML Preformatted"/><w:lsdException w:name="HTML Sample"/><w:lsdException w:name="HTML Typewriter"/><w:lsdException w:name="HTML Variable"/><w:lsdException w:name="Normal Table"/><w:lsdException w:name="annotation subject"/><w:lsdException w:name="Table Simple 1"/><w:lsdException w:name="Table Simple 2"/><w:lsdException w:name="Table Simple 3"/><w:lsdException w:name="Table Classic 1"/><w:lsdException w:name="Table Classic 2"/><w:lsdException w:name="Table Classic 3"/><w:lsdException w:name="Table Classic 4"/><w:lsdException w:name="Table Colorful 1"/><w:lsdException w:name="Table Colorful 2"/><w:lsdException w:name="Table Colorful 3"/><w:lsdException w:name="Table Columns 1"/><w:lsdException w:name="Table Columns 2"/><w:lsdException w:name="Table Columns 3"/><w:lsdException w:name="Table Columns 4"/><w:lsdException w:name="Table Columns 5"/><w:lsdException w:name="Table Grid 1"/><w:lsdException w:name="Table Grid 2"/><w:lsdException w:name="Table Grid 3"/><w:lsdException w:name="Table Grid 4"/><w:lsdException w:name="Table Grid 5"/><w:lsdException w:name="Table Grid 6"/><w:lsdException w:name="Table Grid 7"/><w:lsdException w:name="Table Grid 8"/><w:lsdException w:name="Table List 1"/><w:lsdException w:name="Table List 2"/><w:lsdException w:name="Table List 3"/><w:lsdException w:name="Table List 4"/><w:lsdException w:name="Table List 5"/><w:lsdException w:name="Table List 6"/><w:lsdException w:name="Table List 7"/><w:lsdException w:name="Table List 8"/><w:lsdException w:name="Table 3D effects 1"/><w:lsdException w:name="Table 3D effects 2"/><w:lsdException w:name="Table 3D effects 3"/><w:lsdException w:name="Table Contemporary"/><w:lsdException w:name="Table Elegant"/><w:lsdException w:name="Table Professional"/><w:lsdException w:name="Table Subtle 1"/><w:lsdException w:name="Table Subtle 2"/><w:lsdException w:name="Table Web 1"/><w:lsdException w:name="Table Web 2"/><w:lsdException w:name="Table Web 3"/><w:lsdException w:name="Balloon Text"/><w:lsdException w:name="Table Grid"/><w:lsdException w:name="Table Theme"/><w:lsdException w:name="Light Shading"/><w:lsdException w:name="Light List"/><w:lsdException w:name="Light Grid"/><w:lsdException w:name="Medium Shading 1"/><w:lsdException w:name="Medium Shading 2"/><w:lsdException w:name="Medium List 1"/><w:lsdException w:name="Medium List 2"/><w:lsdException w:name="Medium Grid 1"/><w:lsdException w:name="Medium Grid 2"/><w:lsdException w:name="Medium Grid 3"/><w:lsdException w:name="Dark List"/><w:lsdException w:name="Colorful Shading"/><w:lsdException w:name="Colorful List"/><w:lsdException w:name="Colorful Grid"/><w:lsdException w:name="Light Shading Accent 1"/><w:lsdException w:name="Light List Accent 1"/><w:lsdException w:name="Light Grid Accent 1"/><w:lsdException w:name="Medium Shading 1 Accent 1"/><w:lsdException w:name="Medium Shading 2 Accent 1"/><w:lsdException w:name="Medium List 1 Accent 1"/><w:lsdException w:name="Medium List 2 Accent 1"/><w:lsdException w:name="Medium Grid 1 Accent 1"/><w:lsdException w:name="Medium Grid 2 Accent 1"/><w:lsdException w:name="Medium Grid 3 Accent 1"/><w:lsdException w:name="Dark List Accent 1"/><w:lsdException w:name="Colorful Shading Accent 1"/><w:lsdException w:name="Colorful List Accent 1"/><w:lsdException w:name="Colorful Grid Accent 1"/><w:lsdException w:name="Light Shading Accent 2"/><w:lsdException w:name="Light List Accent 2"/><w:lsdException w:name="Light Grid Accent 2"/><w:lsdException w:name="Medium Shading 1 Accent 2"/><w:lsdException w:name="Medium Shading 2 Accent 2"/><w:lsdException w:name="Medium List 1 Accent 2"/><w:lsdException w:name="Medium List 2 Accent 2"/><w:lsdException w:name="Medium Grid 1 Accent 2"/><w:lsdException w:name="Medium Grid 2 Accent 2"/><w:lsdException w:name="Medium Grid 3 Accent 2"/><w:lsdException w:name="Dark List Accent 2"/><w:lsdException w:name="Colorful Shading Accent 2"/><w:lsdException w:name="Colorful List Accent 2"/><w:lsdException w:name="Colorful Grid Accent 2"/><w:lsdException w:name="Light Shading Accent 3"/><w:lsdException w:name="Light List Accent 3"/><w:lsdException w:name="Light Grid Accent 3"/><w:lsdException w:name="Medium Shading 1 Accent 3"/><w:lsdException w:name="Medium Shading 2 Accent 3"/><w:lsdException w:name="Medium List 1 Accent 3"/><w:lsdException w:name="Medium List 2 Accent 3"/><w:lsdException w:name="Medium Grid 1 Accent 3"/><w:lsdException w:name="Medium Grid 2 Accent 3"/><w:lsdException w:name="Medium Grid 3 Accent 3"/><w:lsdException w:name="Dark List Accent 3"/><w:lsdException w:name="Colorful Shading Accent 3"/><w:lsdException w:name="Colorful List Accent 3"/><w:lsdException w:name="Colorful Grid Accent 3"/><w:lsdException w:name="Light Shading Accent 4"/><w:lsdException w:name="Light List Accent 4"/><w:lsdException w:name="Light Grid Accent 4"/><w:lsdException w:name="Medium Shading 1 Accent 4"/><w:lsdException w:name="Medium Shading 2 Accent 4"/><w:lsdException w:name="Medium List 1 Accent 4"/><w:lsdException w:name="Medium List 2 Accent 4"/><w:lsdException w:name="Medium Grid 1 Accent 4"/><w:lsdException w:name="Medium Grid 2 Accent 4"/><w:lsdException w:name="Medium Grid 3 Accent 4"/><w:lsdException w:name="Dark List Accent 4"/><w:lsdException w:name="Colorful Shading Accent 4"/><w:lsdException w:name="Colorful List Accent 4"/><w:lsdException w:name="Colorful Grid Accent 4"/><w:lsdException w:name="Light Shading Accent 5"/><w:lsdException w:name="Light List Accent 5"/><w:lsdException w:name="Light Grid Accent 5"/><w:lsdException w:name="Medium Shading 1 Accent 5"/><w:lsdException w:name="Medium Shading 2 Accent 5"/><w:lsdException w:name="Medium List 1 Accent 5"/><w:lsdException w:name="Medium List 2 Accent 5"/><w:lsdException w:name="Medium Grid 1 Accent 5"/><w:lsdException w:name="Medium Grid 2 Accent 5"/><w:lsdException w:name="Medium Grid 3 Accent 5"/><w:lsdException w:name="Dark List Accent 5"/><w:lsdException w:name="Colorful Shading Accent 5"/><w:lsdException w:name="Colorful List Accent 5"/><w:lsdException w:name="Colorful Grid Accent 5"/><w:lsdException w:name="Light Shading Accent 6"/><w:lsdException w:name="Light List Accent 6"/><w:lsdException w:name="Light Grid Accent 6"/><w:lsdException w:name="Medium Shading 1 Accent 6"/><w:lsdException w:name="Medium Shading 2 Accent 6"/><w:lsdException w:name="Medium List 1 Accent 6"/><w:lsdException w:name="Medium List 2 Accent 6"/><w:lsdException w:name="Medium Grid 1 Accent 6"/><w:lsdException w:name="Medium Grid 2 Accent 6"/><w:lsdException w:name="Medium Grid 3 Accent 6"/><w:lsdException w:name="Dark List Accent 6"/><w:lsdException w:name="Colorful Shading Accent 6"/><w:lsdException w:name="Colorful List Accent 6"/><w:lsdException w:name="Colorful Grid Accent 6"/></w:latentStyles><w:style w:type="paragraph" w:styleId="a1" w:default="on"><w:name w:val="Normal"/><w:pPr><w:widowControl w:val="off"/><w:jc w:val="both"/></w:pPr><w:rPr><w:rFonts w:ascii="Calibri" w:h-ansi="Calibri" w:fareast="宋體" w:cs="Times New Roman" w:hint="default"/><w:kern w:val="2"/><w:sz w:val="21"/><w:sz-cs w:val="24"/><w:lang w:val="EN-US" w:fareast="ZH-CN"/></w:rPr></w:style><w:style w:type="character" w:styleId="a4" w:default="on"><w:name w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style w:type="table" w:styleId="a2" w:default="on"><w:name w:val="Normal Table"/><w:semiHidden/><w:tblPr><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="table" w:styleId="a3"><w:name w:val="Table Grid"/><w:basedOn w:val="a2"/><w:pPr><w:pStyle w:val="a2"/><w:widowControl w:val="off"/><w:jc w:val="both"/></w:pPr><w:tblPr><w:tblBorders><w:top w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/><w:left w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/><w:bottom w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/><w:right w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/><w:insideH w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/><w:insideV w:val="single" w:sz="4" wx:bdrwidth="10" w:space="0" w:color="auto"/></w:tblBorders></w:tblPr></w:style></w:styles><w:bgPict><w:background/><v:background id="_x0000_s1025"><v:fill on="f" focussize="0,0"/></v:background></w:bgPict><w:docPr><w:view w:val="print"/><w:zoom w:percent="100"/><w:characterSpacingControl w:val="CompressPunctuation"/><w:documentProtection w:enforcement="off"/><w:punctuationKerning/><w:bordersDontSurroundHeader/><w:bordersDontSurroundFooter/><w:defaultTabStop w:val="420"/><w:drawingGridVerticalSpacing w:val="156"/><w:displayHorizontalDrawingGridEvery w:val="0"/><w:displayVerticalDrawingGridEvery w:val="2"/><w:compat><w:adjustLineHeightInTable/><w:ulTrailSpace/><w:doNotExpandShiftReturn/><w:balanceSingleByteDoubleByteWidth/><w:useFELayout/><w:spaceForUL/><w:wrapTextWithPunct/><w:breakWrappedTables/><w:useAsianBreakRules/><w:dontGrowAutofit/><w:useFELayout/></w:compat></w:docPr><w:body><wx:sect><#list imgData as imgMap><w:p><w:pPr><w:keepNext w:val="off"/><w:keepLines w:val="off"/><w:widowControl/><w:listPr><w:ilvl w:val="0"/><w:ilfo w:val="1"/></w:listPr><w:supressLineNumbers w:val="off"/><w:jc w:val="both"/><w:rPr><w:rFonts w:ascii="宋體" w:h-ansi="宋體" w:fareast="宋體" w:cs="宋體" w:hint="fareast"/><w:color w:val="000000"/><w:kern w:val="0"/><w:sz w:val="18"/><w:sz-cs w:val="18"/><w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii="宋體" w:h-ansi="宋體" w:fareast="宋體" w:cs="宋體" w:hint="fareast"/><w:color w:val="000000"/><w:kern w:val="0"/><w:sz w:val="18"/><w:sz-cs w:val="18"/><w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/></w:rPr><w:t>${imgMap.name}</w:t></w:r><w:r><w:rPr><w:rFonts w:ascii="宋體" w:h-ansi="宋體" w:fareast="宋體" w:cs="宋體" w:hint="default"/><w:color w:val="000000"/><w:kern w:val="0"/><w:sz w:val="18"/><w:sz-cs w:val="18"/><w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/></w:rPr><w:t>:</w:t></w:r></w:p><#list imgMap.imgList as img><w:p><w:pPr><w:keepNext w:val="off"/><w:keepLines w:val="off"/><w:widowControl/><w:supressLineNumbers w:val="off"/><w:jc w:val="both"/><w:rPr><w:rFonts w:ascii="宋體" w:h-ansi="宋體" w:fareast="宋體" w:cs="宋體" w:hint="fareast"/><w:color w:val="000000"/><w:kern w:val="0"/><w:sz w:val="18"/><w:sz-cs w:val="18"/><w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/></w:rPr></w:pPr><w:r><w:rPr><w:rFonts w:ascii="宋體" w:h-ansi="宋體" w:fareast="宋體" w:cs="宋體" w:hint="fareast"/><w:color w:val="000000"/><w:kern w:val="0"/><w:sz w:val="18"/><w:sz-cs w:val="18"/><w:lang w:val="EN-US" w:fareast="ZH-CN" w:bidi="AR-SA"/></w:rPr><w:pict><w:binData w:name="wordml://${img.name}">${img.data}</w:binData><v:shape id="_x0000_s1026" o:spt="75" alt="" type="#_x0000_t75"style="height:${img.height}pt;width:${img.width}pt;" filled="f" o:preferrelative="t" stroked="f"coordsize="21600,21600"><v:path/><v:fill on="f" focussize="0,0"/><v:stroke on="f"/><v:imagedata src="wordml://${img.name}" o:title=""/><o:lock v:ext="edit" aspectratio="f"/><w10:wrap type="none"/><w10:anchorlock/></v:shape></w:pict></w:r></w:p></#list></#list><w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="851" w:footer="992"w:gutter="0"/><w:cols w:space="425"/><w:docGrid w:type="lines" w:line-pitch="312"/></w:sectPr></wx:sect></w:body></w:wordDocument>總結
以上是生活随笔為你收集整理的【Freemarker】java代码wps word带图片动态模板生成的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2018-3 碰撞的小球(C++)
- 下一篇: 软件测试进阶之路 - 目录 (持续更新)