Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not properly translate arabic pdf document to text #11

Open
GoogleCodeExporter opened this issue Aug 14, 2015 · 5 comments
Open

does not properly translate arabic pdf document to text #11

GoogleCodeExporter opened this issue Aug 14, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 12 Aug 2010 at 8:30

@GoogleCodeExporter
Copy link
Author

operating system is windows xp

Original comment by [email protected] on 12 Aug 2010 at 8:32

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 23 Jan 2011 at 5:45

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Do you have a file to make some tests?

Original comment by [email protected] on 2 Feb 2011 at 8:45

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 3 Feb 2011 at 5:06

Attachments:

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 9 Feb 2011 at 5:39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant