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

Source: Internet
Author: User
Tags repetition

A single picture shows:

First, write a document in Word format, insert a picture in it, then rename it to FTL, and then open it with the editor, and replace the base64 message with the Freemarker expression. Then output the image information to the template.

multiple images show:

Note that when multiple images are displayed, when the list is looping, if you do not change the value of the image two attributes W:name, imagedata src then it is always the address of the first image to be called, showing the first picture.

change two properties W:name and imagedata src的方法:

  用变量个体的索引来改变两个属性的名字,The index format of the variable individual is "variable name _index", see the Red Bold font section below.

<#listimages as Im><w:pict>    <V:shapetypeID= "_x0000_t75"coordsize= "21600,21600"O:SPT= " the"o:preferrelative= "T"Path= "[Email protected]@[email protected]@[email protected]@[email protected]@5xe"filled= "F"stroked= "F">        <V:strokeJoinstyle= "Miter"/>        <V:formulas>            <v:feqn= "If linedrawn pixellinewidth 0"/>            <v:feqn= "sum @0 1 0"/>            <v:feqn= "Sum 0 0 @1"/>            <v:feqn= "Prod @2 1 2"/>            <v:feqn= "Prod @3 21600 pixelwidth"/>            <v:feqn= "Prod @3 21600 pixelheight"/>            <v:feqn= "sum @0 0 1"/>            <v:feqn= "Prod @6 1 2"/>            <v:feqn= "Prod @7 21600 pixelwidth"/>            <v:feqn= "sum @8 21600 0"/>            <v:feqn= "Prod @7 21600 pixelheight"/>            <v:feqn= "sum @10 21600 0"/>        </V:formulas>        <V:pathO:extrusionok= "F"Gradientshapeok= "T"O:connecttype= "Rect"/>        <O:lockV:ext= "Edit"Aspectratio= "T"/>    </V:shapetype>    <W:bindataW:name="${"wordml://0200000 "+im_index+1+". jpg "}" Xml:space= "preserve">${im}</W:bindata>    <V:shapeID= "Picture"O:spid= "_x0000_i1025"type= "#_x0000_t75"style= "Width:414.75pt;height:207.75pt;visibility:visible;mso-wrap-style:square">        <V:imagedatasrc="${"wordml://0200000 "+im_index+1+". jpg "}" O:title= "Menu"/>    </V:shape></w:pict></#list>

Resources:

http://www.oschina.net/question/246518_45251http://bbs.csdn.net/topics/390556319?page=1# post-397392952 This article turns from: http://blog.csdn.net/stormwy/article/details/40080127

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

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.