Place the document on a contrasting background and make sure all four edges are visible. Improve the lighting, remove shadows, and keep the camera parallel to the page.
When manual crop correction is available, adjust the border before saving. If only one page is affected, retake that page rather than changing the whole document.