« April 16, 2007 | Main | April 19, 2007 »

April 17, 2007 Archives

April 17, 2007

Adding OMR Marks

We had a question come up on an internal mailing list yesterday that got me thinking. Can BIP/XMLP add OMR marks to documents? For the uninitiated, OMR, or Optical Mark Recognition, in one of its simpler forms is the series of 'slugs' (technical term) you see on the right hand side of your paper phone bill. They are short 1/2 inch (1.2cm ... sorry Europe Im all inches now :) lines that tell a paper folding machine where to fold the paper prior to sticking the sheets into an envelope.

This is not the only application of OMR, the routing and account numbers on checks are of the same ilk i.e. machine readable. I have covered checks in other postings and there is a white paper on the BIP OTN pages. Those of you in Europe and maybe the rest of the world that have taken 'multiple guess', sorry 'multiple choice' (MC) exam papers and have had to fill in the appropriate ellipse shape corresponding to what you think is the correct answer are using OMR technology.
I always thought these were the easiest exams until I got to university. My Applied Chemistry professor announced to a greatly relieved class that our mid and final term papers would be in a multiple choice format ... fan-tas-tic! Oh how wrong we were! My experience of MC thus far had been of the four choices, you could throw out one as being completely ridiculous. As long as you knew something on the subject, another two were 'dodgy' so that left the correct answer - easy right. Our professor put a twist on the format:


  • We had 200 questions
  • 5 choices not 4 - none of which were obviously wrong
  • Get a question incorrect and you lost 2 points, dont answer and lose 1 point - this was done to put off the student who hedged their bets and relied on the 20% chance that they would get questions right if they picked ABCDEABCDEABCDE .... we had some real high achievers in our classes :o)
Maybe it was not quite that nasty ... still it gave you huge incentive to learn the material and we covered so much information in the two hours a week we had with her that your hand would be cramping by the time class finished or you'd be begging classmates for a copy of their unintelligible notes. Anyway, I passed ... lesson learned, 'if you see MC be waryee' a mantra I have lived by since.

Slugging Options


Anyway, I digress ... badly. So, just how can you add those marks to your output? 
There are commercial OMR fonts out on the market but for the purposes of marking paper for folding we have found that you can either use the '-' or '_' characters or a simple line drawing to creat the slug. All of the 'folding' manufacturers publish the dimensions of the the slug they need so its just a case of changing the font size or the line thickness/length to the desired size. There are a couple of options both work but it depends on your requirements.
a. Some machines just require marks to tell it where to fold, maybe 2 or 3 per page or
b. Requirements are more sophisticated, checksum slugs that need to appear only on the last page or on eavery X number of pages.
Options:


  • Use line drawings - I have covered elsewhere how you can manipulate drawings in the RTF templates. You can use the same technique to create the necessary 'slugs' and then repeat them down the page on every page unless you put in a section break. This method can and does work for 'a'
  • Use PDF APIs - assume your PDF has been generated. You can now use the PDF APIs, taking advatage of the watermarking method you can add the slug to specific x,y positions on particular pages. We have customers using this method combined with the page counting API and the bursting engine.

    1. Burst a set of documents and subscribe to the BurstListener,
    2. as the document is generated, grab it, count the pages - FormProcessor.getPageNumber() 
    3. calculate where and then apply the 'slugs' to each page appropriately - PDFDocMerger.setTextXXXX - where XXXX are the methods to set text, font and position. 
    4. deliver document to paper folder

You do not have to use the bursting engine to add the marks. You can add them to any PDF document, you could create a printer driver that called the API prior to sending the document to the printer so you do not have to interrupt or meddle with the concurrent manager - I covered how to do this in the EBS Delivery series.

Of the two, 1 is simpler but of course only meets the simpler requirements. Option 2 requires java (simple java mind you) and a little custom work but its well within your means.
Happy Slugging!

About April 2007

This page contains all entries posted to Oracle BI Publisher Blog in April 2007. They are listed from oldest to newest.

April 16, 2007 is the previous archive.

April 19, 2007 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle