In pinhole integral imaging (PII)‐based hologram, each pinhole is regarded as a point light source to emit light rays in different directions to simulate light propagation from the reconstructed 3D information to the computer‐generated hologram (CGH). The PII‐based hologram presents at a working mode similar to resolution‐priority integral imaging (RPII). The depth of field (DOF) is inevitably limited. In this paper, we use twice close‐range capturing to enhance the DOF of this hologram. Twice close‐range capturing can ensure that the virtual objects with different depths are not far from their respective image reference planes, and the detailed information of the back object also can be preserved. Besides, we use a simple ray‐tracing method to solve the occlusion problems. Numerical and optical reconstruction verified that the proposed method can reconstruct clearer 3D images compared with the single capturing method. In addition, the proposed method can present a natural occlusion effect. Thus, the DOF is enhanced.