We propose an active method to rectify the geometric and photometric distortions in a document image. This method uses structured beams projected upon the curved document page to recover the spatial curves on it. A developable surface is interpolated to the curves by finding the correspondence between them. To correct the geometric distortion, the estimated developable surface is finally flattened onto a plane by explicitly solving a system of ordinary differential equations. The recovered 3D page shape, together with a Lambertian illumination model as guidance, is further used to rectify the non-uniform illumination in the images. Experimental results based on a variety of synthetic and real-captured document images demonstrate the effectiveness and efficiency of the proposed method.