<com.webreach.mirth.model.Channel>
  <id>6f5bb7f9-5d79-439d-9929-9e95bafe2770</id>
  <name>PDF Version Converter</name>
  <description></description>
  <enabled>true</enabled>
  <version>1.6.1.2750</version>
  <revision>6</revision>
  <sourceConnector>
    <name>sourceConnector</name>
    <properties>
      <property name="moveToDirectory"></property>
      <property name="checkFileAge">0</property>
      <property name="host">folders/sftp_users/muse/files/inbox</property>
      <property name="pollingType">interval</property>
      <property name="fileFilter">*.pdf</property>
      <property name="charsetEncoding">DEFAULT_ENCODING</property>
      <property name="autoDelete">1</property>
      <property name="binary">1</property>
      <property name="pollingFrequency">1000</property>
      <property name="moveToPattern"></property>
      <property name="fileAge">0</property>
      <property name="DataType">File Reader</property>
      <property name="processBatchFiles">0</property>
      <property name="sortAttribute">date</property>
    </properties>
    <transformer>
      <steps>
        <com.webreach.mirth.model.Step>
          <sequenceNumber>0</sequenceNumber>
          <name>tmp[&apos;contents&apos;]</name>
          <script>tmp[&apos;contents&apos;] = validate(&quot;CDATA[&quot; + msg[&apos;contents&apos;].toString() + &quot;]&quot;, &apos;&apos;, new Array());</script>
          <type>Message Builder</type>
          <data class="map">
            <entry>
              <string>Mapping</string>
              <string>&quot;CDATA[&quot; + msg[&apos;contents&apos;].toString() + &quot;]&quot;</string>
            </entry>
            <entry>
              <string>Variable</string>
              <string>tmp[&apos;contents&apos;]</string>
            </entry>
            <entry>
              <string>RegularExpressions</string>
              <list/>
            </entry>
            <entry>
              <string>DefaultValue</string>
              <string></string>
            </entry>
          </data>
        </com.webreach.mirth.model.Step>
        <com.webreach.mirth.model.Step>
          <sequenceNumber>1</sequenceNumber>
          <name>tmp[&apos;filename&apos;]</name>
          <script>tmp[&apos;filename&apos;] = validate($(&apos;originalFilename&apos;), &apos;&apos;, new Array());</script>
          <type>Message Builder</type>
          <data class="map">
            <entry>
              <string>Mapping</string>
              <string>$(&apos;originalFilename&apos;)</string>
            </entry>
            <entry>
              <string>Variable</string>
              <string>tmp[&apos;filename&apos;]</string>
            </entry>
            <entry>
              <string>RegularExpressions</string>
              <list/>
            </entry>
            <entry>
              <string>DefaultValue</string>
              <string></string>
            </entry>
          </data>
        </com.webreach.mirth.model.Step>
      </steps>
      <inboundTemplate>&lt;message&gt;&lt;contents&gt;&lt;/contents&gt;&lt;/message&gt;</inboundTemplate>
      <outboundTemplate>&lt;message&gt;&lt;filename&gt;&lt;/filename&gt;&lt;contents&gt;&lt;/contents&gt;&lt;/message&gt;</outboundTemplate>
      <inboundProtocol>XML</inboundProtocol>
      <outboundProtocol>XML</outboundProtocol>
      <inboundProperties/>
      <outboundProperties/>
    </transformer>
    <filter>
      <rules/>
    </filter>
    <transportName>File Reader</transportName>
    <mode>SOURCE</mode>
    <enabled>true</enabled>
  </sourceConnector>
  <destinationConnectors>
    <com.webreach.mirth.model.Connector>
      <name>Destination 1</name>
      <properties>
        <property name="template">${message.encodedData}</property>
        <property name="host">sink</property>
        <property name="channelName">None</property>
        <property name="synchronised">0</property>
        <property name="DataType">Channel Writer</property>
      </properties>
      <transformer>
        <steps>
          <com.webreach.mirth.model.Step>
            <sequenceNumber>0</sequenceNumber>
            <name>New Step</name>
            <script>var in_location = &quot;folders/sftp_users/muse/files/inbox/&quot; + $(&apos;originalFilename&apos;);
var readpdf = new Packages.com.lowagie.text.pdf.PdfReader(in_location);

var out_location  = &quot;folders/sftp_users/muse/files/outbox/&quot; + $(&apos;originalFilename&apos;);
var output = new Packages.java.io.FileOutputStream(out_location);
var stamppdf = new Packages.com.lowagie.text.pdf.PdfStamper(readpdf, output);
stamppdf.close();

java.lang.Runtime.getRuntime().exec(&quot;rm folders/sftp_users/muse/files/inbox/&quot; + $(&apos;originalFilename&apos;));</script>
            <type>JavaScript</type>
            <data class="map">
              <entry>
                <string>Script</string>
                <string>var in_location = &quot;folders/sftp_users/muse/files/inbox/&quot; + $(&apos;originalFilename&apos;);
var readpdf = new Packages.com.lowagie.text.pdf.PdfReader(in_location);

var out_location  = &quot;folders/sftp_users/muse/files/outbox/&quot; + $(&apos;originalFilename&apos;);
var output = new Packages.java.io.FileOutputStream(out_location);
var stamppdf = new Packages.com.lowagie.text.pdf.PdfStamper(readpdf, output);
stamppdf.close();

java.lang.Runtime.getRuntime().exec(&quot;rm folders/sftp_users/muse/files/inbox/&quot; + $(&apos;originalFilename&apos;));</string>
              </entry>
            </data>
          </com.webreach.mirth.model.Step>
        </steps>
        <inboundTemplate></inboundTemplate>
        <outboundTemplate></outboundTemplate>
        <inboundProtocol>XML</inboundProtocol>
        <outboundProtocol>XML</outboundProtocol>
        <inboundProperties/>
        <outboundProperties/>
      </transformer>
      <filter>
        <rules/>
      </filter>
      <transportName>Channel Writer</transportName>
      <mode>DESTINATION</mode>
      <enabled>true</enabled>
    </com.webreach.mirth.model.Connector>
  </destinationConnectors>
  <properties>
    <property name="synchronous">true</property>
    <property name="removeNamespace">true</property>
    <property name="encryptData">false</property>
    <property name="store_messages">true</property>
    <property name="dont_store_filtered">false</property>
    <property name="initialState">stopped</property>
    <property name="max_message_age">-1</property>
    <property name="transactional">false</property>
    <property name="error_messages_only">false</property>
  </properties>
  <preprocessingScript>// Modify the message variable below to pre process data
message = &quot;&lt;message&gt;&lt;contents&gt;&quot; + message + &quot;&lt;/contents&gt;&lt;/message&gt;&quot;;
return message;</preprocessingScript>
  <postprocessingScript>// This script executes once after a message has been processed
return;</postprocessingScript>
  <deployScript>// This script executes once when the mule engine is started
// You only have access to the globalMap here to persist data
return;</deployScript>
  <shutdownScript>// This script executes once when the mule engine is stopped
// You only have access to the globalMap here to persist data
return;</shutdownScript>
</com.webreach.mirth.model.Channel>