I have a scanned book as a pdf file.

Some pages are not correctly align and need some rotation, less than 90 degrees, obviously. The text in the pages has not very good defined limits, but there are some decorative lines vertical or horizontal that can be used as markers.

Is there any solution to fix the pages one by one, drawing a line or something similar that defines the orientation optically?

1 Answer 1


Some PDF-handling programs have options to automatically de-skew files as they're processing them.

Generally, the procedure is to split the PDF into one image file per page, deskewing each image, and then merge all the pages back into a new PDF file.

Some programs can do this splitting/deskewing/merging process automatically - e.g. ocrmypdf, which can add a text layer to PDFs which don't already have one (or replace the existing text layer with a new one) has a --deskew option which does this for each page before using tesseract-ocr to generate the text.

There are also programs like deskew and pagetools for manually deskewing individual image files (in a variety of formats).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.