These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Vehicle Identification Number validation in acrobat

aladdin
Registered: Sep 22 2011
Posts: 3

Im looking for a way to calculate a VIN's check digit in Acrobat.
 
Ive seen ways that excel can do this, but nothing in acrobat.
 
Any help please?
  
Thanks
Matt

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
All you have to do is write a script to perform the check digit calculation.

You'll find all the info you need here:
http://www.angelfire.com/ca/TORONTO/VIN/checkdigit.php

I'd suggest putting the position multipliers in an array, and the numeric values for the letters in an object. so both are easily accessed in a loop.



Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Some interesting coding possabilities here.

For the letters:

// define array of letter groups, position in array is the numeric value for the letter in the string;
// ------- value of letter:0, 1, 2, 3, 4, 5, 6, 7, 8, 9;
var vinletters = new Array("", "AJ", "BKS", "CLT", "DMU", "ENV", "FOW", "GPX", "HQY", "IRZ");

// series if variable of VIN number;
// Look up letter's value: ;
for (i=0 ; i < series.length; i++) {
nextchar = series.charAt(i);
for (j in vinletters) {
// change letters to numbers
if(vinletters[j].indexOf(nextchar) != -1) {
nextchar = j;
} // end if vinletteres;
} // end for j in vinletters;

George Kaiser