Many thanks for this, I am now trying the settings recommended on your site and its giving some good results. However, I keep occasionally getting one or two fully justified lines which are much smaller than the rest. I have attached a sample page that shows this. The document was 8.5 inches wide, and I gave an odpi of 198, with right justification and RTL scanning also enabled. Could you please tell me why this happens? Many thanks again!

Yes. See the attached image. You have just enough characters crowding the gap between the lines that k2pdfopt doesn't consider it a clean enough gap. If your text doesn't have any figures, I recommend increasing the gap threshold for the rows--the -gtr option or "gt" in the interactive menu and then the "Gap threshold for rows" entry. Here is the text from the k2pdfopt usage info on -gtr: "Threshold for detecting gaps between rows (expert mode). This sets the maximum total black pixels, in inches, on average, that can be in each row of pixels before the gap is no longer considered a gap. A higher value makes it easier to detect gaps between rows of text. Too high of a value may inadvertently split figures and other graphics. Default = 0.006." At some point I'll do a help page on this.

Try increasing the row-gap threshold slowly until you get the result you want, e.g. .008, .01, .015, etc.