Freemarker picture output, multiple picture output (image repetition reason and resolution)

Source: Internet
Author: User
Tags repetition
Single picture display: First write the word format of the document, insert a picture in it, then rename to FTL, and then open with the editor, the picture that section of base64 information with Freemarker expression replaced. Then output the image information to the template.
Multiple pictures display: It should be noted that when multiple pictures are displayed, when the list loop, if you do not change the image two properties w:name and ImageData src value, then it will always be called the first image of the address, showing the first picture. To change the two properties W:name and ImageData src methods:

Use the index of the variable individual to change the name of the two attribute, the variable individual index format is "variable name _index", see the following Red Bold font section. < #list  images as im>       < w:pict >         < v:shapetype  id = "T75"   coordsize = "21600,21600"   O:SPT = "page"   o:preferrelative = "T"   Path = "M@4@5l@4@11@9@11@9@5xe"   filled = "F"   stroked = "F" >      &nbs p;  < v:stroke  Joinstyle = "miter"/>         < V:formulas > &N bsp;        < v:f  eqn = "if linedrawn pixellinewidth 0"/ >          < v:f  eqn = "sum @0 1 0"/>           < v:f  eqn = "sum 0 0 @1"/>    & nbsp;     < v:f  eqn = "Prod @2 1 2"/>      & Nbsp;   < v:f  eqn = "Prod @3 21600 pixelwidth"/>      & nbsp;   < v:f  eqn = "Prod @3 21600 pixelheight"/>           < v:f  eqn = "sum @0 0 1"/>       & nbsp;  < 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"/>         & Lt o:lock  v:ext = "edit"   Aspectratio = "T"/>        </v:shapetype > &nbs p;      < W:bindata  w:name= "${" wordml://0200000 "+im_index+1+". jpg "}"Xml:space = "preserve" >${im}</W:bindata > < V:shape id = "Picture" O:spid = "i1025" type = "#t75" St YLE = "Width:414.75pt;height:207.75pt;visibility:visible;mso-wrap-style:square" ><v:imagedata src= "${" wordml://0200000 "+im_index+1+". jpg "}"O:title = "Menu"/> </v:shape > </w:pict > </#list >

Reference: http://www.oschina.net/question/246518_45251 http://bbs.csdn.net/topics/390556319?page=1#post-397392952

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.