pescuma / swt-paperclips

Automatically exported from code.google.com/p/swt-paperclips
0 stars 0 forks source link

XMLClips #41

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Allow to input xml as templates for the prints.

Example html:

<page padding="0, 0">
    <header>
        <border size="0.5cm, 0, 0.5cm, 0" color="#B0BFD9">
            <grid cols="d, d:g" margins="0, 0.5cm, 0, 0.3cm" background="#B0BFD9">
                <image src="imgs/receita_topo.png" size="2.2cm" vAlign="center" hAlign="center" />
                <grid cols="c:d:g">
                    <text font="Verdana,15">Name</text>
                    <text font="Verdana,9">Adress</text>
                </grid>
            </grid>

            <grid cols="d:g, r:p" margins="0.5cm, 0.5cm, 0.5cm, 1cm">
                <text font="Verdana,17">To $client</text>
                <text font="Verdana,17">$date</text>
                <if test="phone">
                    <text font="Verdana,17" colspan="*">Phone: $phone</text>
                </if>
            </grid>
        </border>
    </header>
    <body>
        <border size="0.5cm, 0, 0.5cm, 0" color="#B0BFD9">
            <background image="imgs/receita_fundo.png" scaling="proportional" factor="0.7">
                <grid cols="r:p, d:g" spacing="5, 0.5cm" cellClipping="true" margins="0.5cm, 0, 0.5cm, 0">
                    <foreach var="formula" index="i" items="formulas">
                        <text font="Verdana,17">$i.</text>

                        <grid cols="d, d:g" spacing="10, 0">
                            <if test="formula.Introduction">
                                <text font="Verdana,17" colspan="*">$formula.Introduction</text>
                            </if>
                            <foreach var="ingredient" items="formula.Ingredients">
                                <if test="ingredient.Quantity">
                                    <grid cols="d, 30:g" spacing="10, 0">
                                        <text font="Verdana,17">$ingredient.Name</text>
                                        <line direction="horizontal" thickness="0.5" vAlign="center" />
                                    </grid>
                                    <text font="Verdana,17">$ingredient.Quantity</text>
                                </if>
                                <if not="ingredient.Quantity">
                                    <text font="Verdana,17" colspan="*">$ingredient.Name</text>
                                </if>
                            </foreach>
                            <if test="formula.HowToUse">
                                <text font="Verdana,17" colspan="*">$formula.HowToUse</text>
                            </if>
                        </grid>
                    </foreach>
                </grid>
            </background>
        </border>
    </body>
    <footer>
        <border size="0.5cm, 0, 0.5cm, 0" color="#B0BFD9">
            <pageNumber margins="0.2cm"><text font="Verdana,10">#if($pageCount > 1)$pageNumber / $pageCount#end</text></pageNumber>

            <grid cols="c:d:g" margins="0, 0.3cm, 0, 0.5cm" background="#B0BFD9">
                <text font="Verdana,10">Adress</text>
            </grid>
        </border>
    </footer>
</page>

Original issue reported on code.google.com by pescuma on 7 Jun 2012 at 12:20

Attachments:

GoogleCodeExporter commented 9 years ago
Well, you've been busy!

My apologies for not noticing the issues you opened before now--all my project 
updates were still sending to an old email address I no longer use. I'll try to 
catch up on all these issues tonight.

-Matthew

Original comment by qualidaf...@gmail.com on 18 Sep 2012 at 7:41