UPDATE: RTFM cscat
Great job William! Thanks again...
Spoiler:
Ummm, would adding support for languages like Persian (my native language), which is RTL, difficult? (Personally, I don't think so... if it was open-source, it'd have been a breeze though!
)
Details for
willus:
Out of curiosity, I tried to convert one pdf and I knew it would do the following but anyway I did it in practice:
Example for original line:
شاهنامه شاهنامه شاهنامه شاهنامه فردوسی فردوسی فردوسی فردوسی
which is supposed to be read from RTL (so in this example the
block all with word "شاهنامه" should be first and then the
block with word "فردوسی"), but the output of k2pdfopt now is:
فردوسی فردوسی فردوسی فردوسی
شاهنامه شاهنامه شاهنامه شاهنامه
which is incorrect.