This project has moved and is read-only. For the latest updates, please go here.

ISBN Number from Result

Mar 9, 2015 at 2:43 AM
Hi, I am using ZXIng in my Universal project(Windows 8.1/ Windows Phone 8.1). I want to be able to get the ISBN number from a book's UPC code. I am successfully scanning the barcode and getting the UPC number back along with some metadata(price, country,etc...). But nowhere in the Result do I see the ISBN. I assumed that the ISBN was contained within the UPC. Do I need to configure my BarCodeReader to pick this data up, or is there another way I need to get the ISBN number from the UPC?

Mar 9, 2015 at 7:48 PM
If you scan an UPC you will get an UPC, not an ISBN. An UPC barcode only contains the UPC number.
There is no built-in conversion from UPC to ISBN or a database lookup or something similar.
The result parser only divides the UPC in it's product related elements like price, country, etc.
If you need the ISBN you have to implement the necessary logic for conversion or an
online lookup.
On the other hand there is EAN. At wikipedia you will find some information about the
relation between ISBN and EAN-13:

Perhaps you can send me a sample picture of the barcode, so that I can verify all the details.
Mar 10, 2015 at 12:04 AM
Below is a link to a shot of the barcode I am using for testing. Do you know how to do the conversion or any online APIs/lookups that accept the UPC barcode?

I want my app to have a barcode scanning feature, but if it's not possible I suppose I will have to take it out.

Thanks for your help!
Mar 10, 2015 at 10:50 PM
Ok, here we go. I googled a little bit around for you.
First, there are different ways how an ISBN is encoded and printed on a book.
If you have newer books you will find an ISBN number directly encoded as an EAN-13 code. That kind of EAN-13 is called Bookland Codes.
They start with "978". If you use the ResultParser class with the Result string from the decoder you will get an ISBNParsedResult object.
On older books the ISBN is encoded as an UPC with a 5 digit extension. That's the case in your sample picture.
You have to use a lookup table to convert the UPC vendor code to an ISBN vendor code. Then you have to add the 5 digits from the extension
and calculate the checksum number.
In your case, UPC vendor code 037145 translates to the ISBN vendor code 0812. Add now the 5 extension digits 54809. Calculate the checksum which
should be 4 -> 0-812-54809-4.
I found a small translation table here:
The main problem is the 5 digits extension. It can be read by ZXing.Net BUT if the UPC code is found in an image row which doesn't contain
the extension barcode then you won't get it. It only returns the UPC code.
You can try it yourself. Crop the image that only the real barcode is visible. That should "simulate" a mobile phone which only centers the barcode
in the middle of the sanning region. The result object should contain now an entry with the key ResultMetadataType.UPC_EAN_EXTENSION in Result.ResultMetadata.
That's the 5 digits extension.
Mar 15, 2015 at 6:52 PM
That helped a lot. Thanks! I tried scanning books later than 2006 and they work like a charm. For now, I think I will just let my users know that scanning books pre 2007 will not be possible.