No person shall be compelled to pay any fees before mentioned due to an officer, until there be produced to him a fee bill signed by the officer to whom the fees are due, expressing particulars for which such fees are charged. And no such fee bill shall be made out for any service not previously performed, except as hereinafter provided, unless a person desire to pay before such performance, in which case there shall be mentioned in such fee bill the nature of the service and the fact that it is to be performed. Nor shall an officer, for any service, make out a fee bill for more than is allowed therefor. Nor shall he for the same service, attempt to obtain payment a second time; nor ever make out a fee bill a second time, unless he indorse the fact that the fee bill made out is a second fee bill and swear that the former bill remains unpaid. For each item in which an officer shall violate this section, he shall forfeit $5 to any person prosecuting therefor, and the circuit court of the county in which an officer resides may on motion, after reasonable notice to him quash any fee bill made out by him contrary to law. But any officer may demand his fees in advance for any particular service required to be performed by him for any person not residing in his county, and if such fees be not paid or secured to him the officer may refuse to perform the service until they are paid or secured. In such cases, the fee bill shall state the nature of the service, and that it is to be performed.