If a Magistrate of the first class is satisfied that, for the purposes of any investigation or proceeding under this Sanhita, it is expedient to direct any person, including an accused person, to give specimen signatures or finger impressions or handwriting or voice sample, he may make an order to that effect and in that case the person to whom the order relates shall be produced or shall attend at the time and place specified in such order and shall give his specimen signatures or finger impressions or handwriting or voice sample:
Provided that no order shall be made under this section unless the person has at some time been arrested in connection with such investigation or proceeding:
Provided further that the Magistrate may, for the reasons to be recorded in writing, order any person to give such specimen or sample without him being arrested.