elyasaf / pdfviewer-win32

Automatically exported from code.google.com/p/pdfviewer-win32
0 stars 0 forks source link

does not properly translate arabic pdf document to text #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I used PDFLibNet.dll for my projet to extract Arabic pdf document to text.
2. used method pdfDoc.ExportText("c.txt",1,1,true,false);

What is the expected output? What do you see instead?
I was expected maintain physical layout and translate document to text file 
format.but issue is when translate the document value change their order. 
as example 
1. expected out put as  "007" but receive output is 700, 
2. in the Arabic word are ok
 please help to me to overcome above issue.  

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by mgdhsand...@gmail.com on 12 Aug 2010 at 8:30

GoogleCodeExporter commented 8 years ago
operating system is windows xp

Original comment by mgdhsand...@gmail.com on 12 Aug 2010 at 8:32

GoogleCodeExporter commented 8 years ago

Original comment by plazacom...@gmail.com on 23 Jan 2011 at 5:45

GoogleCodeExporter commented 8 years ago
Do you have a file to make some tests?

Original comment by plazacom...@gmail.com on 2 Feb 2011 at 8:45

GoogleCodeExporter commented 8 years ago
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:

GoogleCodeExporter commented 8 years ago
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