With the popularity of mobile and enhancement of mobile camera function, traditional digital cameras and scanner functions are gradually replaced by mobile camera. There are a lot of APP on mobile and able to scan paper documents. For photographic image processing, determining the boundaries of the document area from the mobile image is the first and important step. For the traditional document image obtained by the scanner, the commonly used algorithm is the Hough transform [1]. However, the mobile images are generally fuzzy, distortion because of un-uniform light source and unfixed focal length, which are introduced by the portability of mobile. Hough transform cannot solve the problem of boundary detection of mobile image very well. In addition, edge detection of using Hough transform is relatively slow, which result into being difficult to run on the mobile. In this paper, we utilize dynamic programming [2] algorithm to determine the boundary of the document, and the K-Nearest Neighbor Classification [3] algorithm to select the four edges from the candidate boundaries, and quickly segment document area. The two algorithms are efficient and have high accuracy of detecting boundary, and have been integrated in the mobile APP.