MiniViewers and Barcodes in KTM

..and the price for not being helpful goes to: MiniViewers and the Barcode Locator. No, really – I’ll let you be the judge, this is what you get when combining the two:

bc_locator_default

Not useful at all, as – if you take a look at the document – the plain text is written right below the barcode itself:

barcodes

So, what I want to see in the MiniViewer are not the bars alone, but also the plain text below the barcode:

bc_locator_bars

Let’s take the madness one step further. I don’t want to see the bars at all but the plain text only:

bc_locator_plaintext

The above results can be achieved easily with a little script.


Private Sub BC_AfterExtract(ByVal pXDoc As CASCADELib.CscXDocument, ByVal pField As CASCADELib.CscXDocField)

   Field_ShiftZoneForBarcodes(pField, True, .1)

End Sub

Public Sub Field_ShiftZoneForBarcodes(ByRef pField As CscXDocField, hideBars As Boolean, heightMultiplicator As Double)

   ' more elegant solution
   Dim h As Long

   If hideBars Then
      h = pField.Height * heightMultiplicator
      pField.Top = pField.Top + pField.Height
      pField.Height = h
   Else
      pField.Height = pField.Height * ( 1+ heightMultiplicator)
   End If

End Sub

Oh, and of course you can say, “what makes you believe the barcode is misread in the first place”, and you would be right. With a check digit you won’t even get any misreads and may get rid of the MiniViewer anyway. Well.. let’s just say seeing the actual value just makes me feel better, ok? Besides, you just learned that you can adjust the zones right in script. Awesome.