5 34 12 Example XML Content

LANSA Integrator

5.34.12 Example XML Content

The following XML content example illustrates how the elements are used.

<?xml version="1.0" encoding="utf-8"?>
<!--
     Sample PDF XML document
-->
<!--- Document permissions require password -->
<document page-size="A4"
          background="cyan"
          orientation="portrait"
          border="true"
          author="Acme Corporation"
          title="Document Title"
          subject="Document Subject"
          keywords="word1, word2"
          creator=""
          hide-toolbar=""
          hide-menubar=""
          hide-windowui=""
          allow-printing="true"
          allow-copy="false"
          allow-modify-contents="false"
          allow-modify-annotations="false"
          allow-fillin="false"
          allow-screenreader="false"
          allow-assembly="false"
          allow-degraded-printing="false">
 <content name="top">
   <!--
            Barcode examples
   -->
   <barcode x1="20" y1="700" type="CODE39" value="12345ABCD"/>
   <barcode x1="20" y1="600" type="CODE39EXT" value="12345"/>
   <barcode x1="20" y1="500" type="CODE128" value="12345aBCD"/>
   <barcode x1="20" y1="400" type="CODE128UCC" value="12345aBCD"/>
   <barcode x1="20" y1="300" type="EAN8" value="1234567"/>
   <barcode x1="20" y1="200" type="EAN13" value="641718311430"/>
   <barcode x1="20" y1="100" type="EAN13" value="641718311430" supplement="54995"/>
   <!--
            Design grid
   -->
   <grid/>
   <!--
            Barcode examples
   -->
   <barcode x1="20" y1="700" type="CODABAR" value="4015638721939"/>
   <barcode x1="20" y1="600" type="POSTNET" value="123456789"/>
   <barcode x1="20" y1="500" type="PLANET" value="123456789"/>
   <barcode x1="20" y1="400" type="INTER25" value="41-1200076041-001"/>
   <barcode x1="20" y1="300" type="INTER25" value="411200076041001"/>
   <!--
            Import
            DO NOT do a new page before an import.
            The import internally does a new page before each page read.
            DO a new page after the import to move off the last imported page.
   -->
   <import file="other.pdf"/>
   <page/>
   <input type="field" name="FIELD1" required="true" readonly="" export="" value="text 1" x1="100" y1="750" width="200" length="15" style="form"/>
   <input type="field" name="FIELD2" multiline="true" readonly="true" export="false" value="text 2" x1="100" y1="720" width="200" height="50" length="200" style="form"/>
   <input type="hidden" name="FIELD3" value="SECRET" length="10"/>
   <input type="password" name="FIELD4" x1="100" y1="660" width="30" length="5" style="form"/>
   <input type="checkbox" name="CHECK1" readonly="" value="CHK" selected="true" x1="100" y1="630"/>
   <input type="combobox" name="COMBO1" readonly="" x1="100" y1="600" width="200" length="20" style="form">
      <item value="C1"/>
      <item>C2</item>
      <item value="C3" selected="true"/>
      <item value="C4"/>
      <item value="{XYZ}"/>
      <item value="C6"/>
   </input>
   <input type="radio-group" name="RADIO" readonly="" length="10">
      <input type="radio" value="RAD1" x1="120" y1="540"/>
      <input type="radio" value="RAD2" x1="140" y1="540" selected="true"/>
      <input type="radio" value="RAD3" x1="160" y1="540"/>
   </input>
   <group-box x1="100" y1="560" width="200" height="40" caption="Types" caption-width="50" caption-height="20" caption-indent="10" style="form"/>
   <input type="submit" caption="Submit" url="http://lansa01:88/cgi-bin/jsmdirect?namevalue" x1="100" y1="510" width="50" style="form"/>
   <page/>
 </content>
 <content name="table">
   <!--
           Table using working list
   -->
   <text x1="20" y1="700" width="100" height="20" style="normal" border="" align="left" leading="" value="{@rowcount}"/>
   <annotation name="doc-help" x1="50" y1="550"/>
   <table x1="20" y1="500" width="400" style="normal" alternate="true" alternate-color="" title-show="">
      <column field="FNAME" width-percentage="20" style="italic" vertical-align="top" horizontal-align="right" title-horizontal-align="left" title-border="" title-style="title-beach" title="First Name"/>
      <column field="SNAME" width-percentage="20" vertical-align="bottom" horizontal-align="left" title-horizontal-align="right" title-border="" title="Surname&#xA;Family Name"/>
      <column column-type="image" field="IMAGE" alt-text="none" alt-text-field="FNAME" width-percentage="20" title="Image" value="adobe.gif" scale="70"/>
      <column column-type="barcode" field="ID" width-percentage="20" type="CODE128" scale="" rotation="" start="" stop="" start-stop="" alternate="false" border="false" horizontal-align="center" title-horizontal-align="" title-border="false" title=""/>
   </table>
   <!--
           List using working list data
   -->
   <list x1="20" y1="200" width="200" style="modern" field="SNAME" border="" horizontal-align="right"/>
   <!--
           List using items
   -->
   <list x1="20" y1="100" width="200" style="italic" border="" horizontal-align="">
      <item value="Item1"/>
      <item value="{XYZ}"/>
      <item style="modern">Item 2</item>
      <item>Item 3</item>
   </list>
   <!--
           New page
   -->
   <page/>
 </content>
 <content name="detail">
   <!--
           Text area
   -->
   <text x1="70" y1="500" width="200" height="400" style="text-modern" border="" align="left" leading="">
     <phrase style="modern" options="na">This is the first text phrase</phrase>
     <phrase style="modern-strike" options="na">This is the second text phrase</phrase>
     <phrase style="normal-white" options="na" value="This is the third text phrase as a value attribute"/>
     <phrase options="na" anchor="http://www.lansa.com">anchor</phrase>
     <phrase>Here is an</phrase>
     <phrase options="sb,sa" annotation="explain">annotation</phrase>
     <phrase options="na">example</phrase>
     <phrase options="sb,sb,sb,na,sa" value="{@date}" date-format="dd-MM-yyyy"/>
     <phrase options="na" value="123.45" decimal-format="&#xA4;#,###.##"/>
   </text>
   <!--
           New page
   -->
   <page/>
   <!--
           Add template
   -->
   <add template="logo" x1="20" y1="800"/>
   <add template="logo" x1="20" y1="400"/>
                      
   <add template="image" x1="300" y1="800"/>
   <add template="logo" x1="300" y1="400"/>
   <!--
           New page
   -->
   <page/>
   <text x1="70" y1="600" width="40" height="16" style="normal-white" border="" leading="12" align="center" value="1234"/>
   <text x1="70" y1="550" width="100" height="16" style="normal-white" border="" leading="12" align="center" value="Go to LANSA" anchor="http://www.lansa.com"/>
   <!--
           Signature box and date box
   -->
   <sign-box x1="90" y1="500" width="400" line-width="" message="Sign in blue ink" border=""/>
   <date-box x1="90" y1="300" line-width="" day="dd" month="mm" year="yyyy" border=""/>
 
   <page/>
   <!--
           Image
   -->
   <image x1="70" y1="500" file="univac.jpg" scale="80"/>
 
 </content>
 <content name="bottom">
   <page orientation="landscape"/>
   <text-align x1="100" y1="500" style="italic-blue" align="left" value="Some aligned text 1" rotation="0"/>
   <text x1="70" y1="300" width="100" height="20" border="" align="left" leading="" value="{@page}"/>
   <!--
           Condition logic
   -->
   <if compare="{@page}" value="11" operation="equal" goto="additional"/>
   <if compare="{@page}" value="12" operation="equal">
      <if compare="3" value="12" operation="not_equal">
      
          <page background="yellow"/>
          <text-align x1="100" y1="500" style="beach" align="left" value="Some aligned text 2" rotation="90"/>
          <return/>
      </if>
   </if>
   <text x1="70" y1="300" width="100" height="20" border="" align="left" leading="" value="{@page}"/>
 </content>
 <content name="additional">
   <page/>
   <text x1="70" y1="400" width="400" height="40" style="beach" border="" align="left" leading="" value="additional"/>
   <text x1="70" y1="300" width="400" height="40" style="smokin" border="" align="left" leading="" value="additional"/>
   <text x1="70" y1="200" width="400" height="40" style="smokin-condensed" border="" align="left" leading="" value="additional"/>
 </content>
 <content name="graphic">
   <!--
            Graphic line, rectangle, circle
            These co-ordinates are based on the template rectangle
            <circle x1="100" y1="100" radius="50" stroke-color="" fill-color="" />
   -->
   <line x1="10" y1="290" x2="190" y2="290" stroke-color="blue" line-width=""/>
   <line x1="10" y1="10" x2="190" y2="10" stroke-color="red" line-width=""/>
 </content>
 <!--
        Templates
        co-ordinates are based on the template rectangle
 -->
 <template name="banner" width="200" height="300"/>
 <template name="logo" width="200" height="300">
   <rectangle x1="10" y1="100" width="180" height="40" radius="" fill-color="" stroke-color="" line-width=""/>
 </template>
 <template name="image" width="200" height="300">
   <grid/>
   <page/>
   <import />
   <image x1="0" y1="300" file="univac.jpg" scale="80"/>
 </template>
 <!--
        Custom colors
 -->
 <color name="charcoal" rgb="100,80,90"/>
 <color name="annotation" rgb="251,248,104"/>
 <!--
        Custom styles
 -->
 <style name="default" font="Courier" size="10" style="bold" color="charcoal" encoding="Cp1252"/>
 <style name="form" font="Times-Roman" size="10"/>
 <style name="normal" font="Helvetica" size="10" style="normal" color="black" encoding="Cp1252"/>
 <style name="normal-white" font="Helvetica" size="10" style="normal" color="white" background="black"/>
 <style name="title-beach" file="miami.ttf" size="15" color="black" background="yellow" encoding="Cp1252" embedded="true"/>
 <style name="beach" file="miami.ttf" size="15" color="black" encoding="Cp1252" embedded="true"/>
 <style name="smokin" file="marlbo.ttf" size="15" color="blue" encoding="Cp1252" embedded="true"/>
 <style name="smokin-condensed" file="marlboc.ttf" size="15" color="black" encoding="Cp1252" embedded="true"/>
 <style name="italic" font="Helvetica" size="10" style="italic" color="black"/>
 <style name="strike" font="Helvetica" size="10" style="line-through" color="black"/>
 <style name="text-modern" font="Times-Roman" size="12" style="normal" color="black" background="yellow"/>
 <style name="modern" font="Times-Roman" size="12" style="bold italic" color="red"/>
 <style name="modern-strike" font="Times-Roman" size="12" style="line-through" color="black"/>
 <style name="italic-blue" font="Times-Italic" color="blue" size="20" encoding="Cp1252"/>
 <style name="beach" file="miami.ttf" size="30" color="black" encoding="Cp1252" embedded="true"/>
 <!--
      Annotations
 -->
 <annotation name="doc-help" icon="help" author="author" color="annotation">
    <phrase options="na">This is help one line</phrase>
    <phrase options="na" value="This is help two"/>
    <phrase options="na">This is help three</phrase>
 </annotation>
 <annotation name="explain" type="circle" color="red">
    <phrase options="na">This explains this annotation</phrase>
    <phrase options="na" value="More explaining"/>
 </annotation>
</document>