Open GoogleCodeExporter opened 9 years ago
operating system is windows xp
Original comment by mgdhsand...@gmail.com
on 12 Aug 2010 at 8:32
Original comment by plazacom...@gmail.com
on 23 Jan 2011 at 5:45
Do you have a file to make some tests?
Original comment by plazacom...@gmail.com
on 2 Feb 2011 at 8:45
hi,
I have attached one pdf file with this and text file which is the file that
translated to the pdf document to the text.
Original comment by mgdhsand...@gmail.com
on 3 Feb 2011 at 5:06
Attachments:
The document has a mixture of RTL and LTR. xpdf determines the primary
direction looking each unicode char, the predominant direction is RTL, so xpdf
process all the text as RTL.
// determine the primary direction
lrCount = 0;
for (blk = blkList; blk; blk = blk->next) {
for (line = blk->lines; line; line = line->next) {
for (word0 = line->words; word0; word0 = word0->next) {
for (i = 0; i < word0->len; ++i) {
if (unicodeTypeL(word0->text[i])) {
++lrCount;
} else if (unicodeTypeR(word0->text[i])) {
--lrCount;
}
}
}
}
}
primaryLR = lrCount >= 0;
We can determine the direction of each block of text looking for the unicode
character type. But what happen if the file was created using RTL, including
the LTR characters?.
Original comment by plazacom...@gmail.com
on 9 Feb 2011 at 5:39
Original issue reported on code.google.com by
mgdhsand...@gmail.com
on 12 Aug 2010 at 8:30