
PaperCut
– Ricoh Embedded Manual
Revision: 19
2012-10-26
Copyright © 2012 PaperCut Software International Pty. Ltd., All Rights Reserved.
37 of 41
Enter the name of the required converter (see table below) and click
Update
To set at the device level:
Devices -> [select device] -> Advanced Config Editor
Search for “ext-device.card-no-converter”
Enter the name of the required converter (see table below) and click
Update
Standard Converters
Convertor
Description
hex2dec
Convert a hexadecimal (base 16) encoded card number to
decimal format. Hexadecimal numbers usually contain 0-9 and A-
F. This
will convert “
946EBD28
” to “
2490285352
”.
dec2hex
Convert a decimal encoded card number to hexadecimal format.
This will convert “
2490285352
” to “
946EBD28
”.
ascii-enc
Unpack an ASCII encoded card number string. E.g. given the
number “
3934364542443238
”, the ASCII code “
39
” is converted
to 9, “
34
” -> 4, “
45
” -> E, with the entire number resulting in
“
946EBD28
”.
javascript:<path>
Advanced: Define a custom conversion function in JavaScript (see
below)
It is possible to chain or pipeline converters by delimiting with a pipe (|). For example,
ascii-enc|hex2dec
will first unpack the encoded ASCII number then convert it to a
decimal.
Tip:
Not sure which converter to use? Often trial and error is a good approach. After
presenting a card, the number will appear in an application logger message with conversions
applied (assuming the card is unknown to the system). Try different converters and inspect
the resulting numbers in the application log.
Using custom JavaScript
If the inbuilt converter functions are unable to meet the requirements, it is possible to define
your own function using JavaScript. This is an advanced exercise and it is expected that
any implementer be familiar with programming and JavaScript. To implement your own
converter:
1. Create a file text file
[install-path]/server/custom/card.js
2.
Define a single JavaScript function in this file called “convert” It should accept and
return a single string. Here is a trivial example:
function convert(cardNumber) {
return cardNumber.substring(3,10).toLowerCase();
}
3. Enter a converter in the form:
javascript:custom/card.js
Summary of Contents for Pro 1356EX
Page 34: ......