diff --git a/pdfform.js b/pdfform.js index d7e5e60..bdd7bbf 100644 --- a/pdfform.js +++ b/pdfform.js @@ -430,6 +430,7 @@ function transform(buf, fields) { n.map.AS = n.map.V = n.map.DV = value ? new minipdf_lib.Name('Yes') : new minipdf_lib.Name('Off'); } else if (ft_name == 'Ch') { n.map.V = '' + value; + n.map.I[0] = Math.max(0, n.map.Opt.indexOf(value)); } else if (ft_name == 'Sig') { return; // Signature fields are not supported so far } else { @@ -558,4 +559,4 @@ pdfform.transform = function(buf, fields) {return pdfform().transform(buf, field if (typeof module != 'undefined') { module.exports = pdfform; -} \ No newline at end of file +}