A pneumatic stapler which contains a mechanism for manual or automatic retaining pin placement. The automatic retaining pin is connected to a set of linkage plates actuable by a series of inflation of bladders in order to create instrument closure on tissue compression and simultaneously create pin placement. An optional manual, curved retaining pin is used in place of the automatic pin system. Further, because this instrument has a ramped anvil mechanism, adjustable staple height is derived. Controlled closure of the mechanism is provided with a detent spring and constant force springs. Upon stapling, the staple encounters an anvil with reduced size, which is kept closed by a latched retaining pin system to allow for reduced width of the anvil so that the stapling head becomes more versatile. Finally, after firing the staples, the mechanism is capable of rapid depressurization and simultaneous instrument opening by a spring return mechanism. A shaft connects the head to the handle allowing rotation and articulation in an universal joint or in two discrete locations, both with a locking system enabling the operator to choose angles at which to insert the instrument.