/Controller.cls/
public class docxVFcontroller {
public string base64text {get; set;}
public void getFile()
{
Attachment a = [Select Body from attachment where name like '%word.docx%' limit 1];
blob b = a.body;
base64text = EncodingUtil.base64Encode(b);
}
}
/VF page/ ...
<script type="text/javascript">
var base64 = '{!base64text}';
/* assuming on click of command button i have this base64 text.Please suggest an idea on how would i process this base64 data to json or som other format to process further. Or is there any way to process it in controller only to a json String */
</script>
EncodingUtil.base64decode(yourBase64Blob)
so you can manipulate it as a string? Then you can use all the string methods...