OMR Lines

Scott Beebe

Reputable Poster
Has anyone been been successful at adding OMR lines to an RTF template? I found a couple of posts on Tim Dexter's log. But, they were not helpful enough to solve my problem. Any ideas? Any help would be appreciated. BIP wasn't built to handle this very easily.
 
Hi Scott

You're right. BIP doesn't handle OMR marks at all well. (Larry, they're marks on the top/side of the page for controlling the envelope machine).

I have implemented them, but as far as I know, it can only be done by controlling the pagination yourself within the template, so that you know what marks to put out on each page.

Anyway, my solution was:

1. Use Tim Dexter's Anatomy of a Template solution to output a fixed number of lines per page. That will allow you to calculate the number of pages that you need to print, as well as cycle through the code for each page.

2. The marks in my case varied on an 7 page cycle, so I used a dynamic variable which was incremented on each page, and reset once it got to the eighth:

<font class="small">Code:</font><hr /><pre><?xdoxslt:set_variable($_XDOCTX, 'R42565CycleCount',xdoxslt:get_variable($_XDOCTX, 'R42565CycleCount')+1)?>
<?if@inlines:xdoxslt:get_variable($_XDOCTX, 'R42565CycleCount')=8?>
<?xdoxslt:set_variable($_XDOCTX, 'R42565CycleCount',1)?>
<?end if?>
</pre><hr />

3. There was a separate mark for the last sheet per invoice, so I had to calculate when that occurred:

<font class="small">Code:</font><hr /><pre><xsl:variable name="lastsheet" xdofo:ctx="incontext" select="(count($group) + $lpp - $finallpp) < $start + $lpp*2"/>
</pre><hr />

$group contains all the records for the invoice, $lpp is the lines per page on all but the last page of the invoice, and $finallpp the max lines on the last page.

$start was calculated to be the first record for that page. This is all pretty much in line with Tim's solution:

<font class="small">Code:</font><hr /><pre><?if:((position()-1) mod $lpp=0)?><xsl:variable name="start" xdofo:ctx="incontext" select="position()"/>
</pre><hr />

4. I then created a variable to be used to control each of the marks (slugs) that I needed to output on that page, eg:

<font class="small">Code:</font><hr /><pre><xsl:variable name="slug10" xdofo:ctx="incontext" select="xdoxslt:get_variable($_XDOCTX, 'R42565CycleCount') mod 2>0"/>
<xsl:variable name="slug11" xdofo:ctx="incontext" select="floor(xdoxslt:get_variable($_XDOCTX, 'R42565CycleCount') div 2) mod 2>0"/>
<xsl:variable name="slug12" xdofo:ctx="incontext" select="floor(xdoxslt:get_variable($_XDOCTX, 'R42565CycleCount') div 4) mod 2>0"/>
<xsl:variable name="slug04" xdofo:ctx="incontext" select="$lastsheet"/>
<xsl:variable name="slug09" xdofo:ctx="incontext" select="($slug04 + $slug10 + $slug11 + $slug12) mod 2"/>
</pre><hr />

5. And finally, I put an If statement around each of the marks (which was simply a straight line drawing object/shape. I used a single row table with the columns correctly spaced (use exact widths) and each cell contained one mark. The shapes' wrapping was set to inline to ensure that they printed within the columns.

The If statements are simply:

<font class="small">Code:</font><hr /><pre><?if:$slug12?>
</pre><hr />
before the mark, and the End If afterwards.

Hope you can get something out of that even if it doesn't all make sense
smile.gif
.

Dave
 
Back
Top