We evaluate the rate of pair production in a uniform electric field confined to a bounded region in space. Using the Balian-Bloch expansion of Green's functions we obtain explicit expressions for finite-size corrections to Schwinger's formula. The case of a time-dependent boundary, relevant to describe energy deposition by quark-antiquark pair production in ultrarelativistic collisions, is also investigated. We find that finite-size effects are important in nuclear collisions. They decrease when the strength of the chromoelectric field between the nuclei is large. As a result, the rate of energy deposition increases sharply with the mass number $A$ of the colliding nuclei.