You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "amin bouja (JIRA)" <ji...@apache.org> on 2012/07/23 00:41:36 UTC
[jira] [Created] (PDFBOX-1361) damaged arabic text after extraction
from pdf
amin bouja created PDFBOX-1361:
----------------------------------
Summary: damaged arabic text after extraction from pdf
Key: PDFBOX-1361
URL: https://issues.apache.org/jira/browse/PDFBOX-1361
Project: PDFBox
Issue Type: Bug
Components: Text extraction
Affects Versions: 1.7.0
Environment: Windows 7
Eclipse v: last release
PDFBOX 1.7.0.jar
icu4j-49.jar
Reporter: amin bouja
I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
***********************************************************************************|
PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
PDFTextStripper textStripper = new PDFTextStripper(); |
String Text = textStripper.getText(pddDocument); |
System.out.println(Text); |
***********************************************************************************
I'am having as Output :
05:71 - 2102يوليوز 22األحد
ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
.يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
But it should be:
الأحد 22 يوليوز 2012 - 17:58
أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (PDFBOX-1361) damaged arabic text after
extraction from pdf
Posted by "amin bouja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420359#comment-13420359 ]
amin bouja edited comment on PDFBOX-1361 at 7/22/12 11:02 PM:
--------------------------------------------------------------
As you can see for example, the first word " أضرم " at the second line of the input (the PDF)
is at the middle of the second line in the output text
was (Author: a.boujanane):
As you can see for example, the first word " أضرم " at the second line of the input (the PDF)
is at the middle of the first line in output text
> damaged arabic text after extraction from pdf
> ---------------------------------------------
>
> Key: PDFBOX-1361
> URL: https://issues.apache.org/jira/browse/PDFBOX-1361
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.7.0
> Environment: Windows 7
> Eclipse v: last release
> PDFBOX 1.7.0.jar
> icu4j-49.jar
> Reporter: amin bouja
> Labels: newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
> ***********************************************************************************|
> PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
> PDFTextStripper textStripper = new PDFTextStripper(); |
> String Text = textStripper.getText(pddDocument); |
> System.out.println(Text); |
> ***********************************************************************************
> I'am having as Output :
> 05:71 - 2102يوليوز 22األحد
> ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
> .يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
> But it should be:
> الأحد 22 يوليوز 2012 - 17:58
> أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PDFBOX-1361) damaged arabic text after
extraction from pdf
Posted by "Andreas Lehmkühler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420448#comment-13420448 ]
Andreas Lehmkühler commented on PDFBOX-1361:
--------------------------------------------
Looks like a sorting issue. Try to activate the sorting using textStripper.setSortByPosition(true)
> damaged arabic text after extraction from pdf
> ---------------------------------------------
>
> Key: PDFBOX-1361
> URL: https://issues.apache.org/jira/browse/PDFBOX-1361
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.7.0
> Environment: Windows 7
> Eclipse v: last release
> PDFBOX 1.7.0.jar
> icu4j-49.jar
> Reporter: amin bouja
> Labels: newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
> ***********************************************************************************|
> PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
> PDFTextStripper textStripper = new PDFTextStripper(); |
> String Text = textStripper.getText(pddDocument); |
> System.out.println(Text); |
> ***********************************************************************************
> I'am having as Output :
> 05:71 - 2102يوليوز 22األحد
> ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
> .يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
> But it should be:
> الأحد 22 يوليوز 2012 - 17:58
> أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (PDFBOX-1361) damaged arabic text after
extraction from pdf
Posted by "amin bouja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420611#comment-13420611 ]
amin bouja edited comment on PDFBOX-1361 at 7/23/12 12:49 PM:
--------------------------------------------------------------
thank you :)
Using ** textStripper.setSortByPosition(true) ** a text containing just Arabic or french words is correctly extracted, but not a text containing Arabic and french words, OR Arabic and french numbers:
eg: (Arabic words and french numbers)
Input
******************************
سنة 2012
شهر 07
يوم 23
سنة 2012 و شهر 07 و يوم 23
******************************
Output
*****************************
سنة 0810
شهر 80
يوم 02
سنة 0810 و شهر 80 و يوم 02
*****************************
notice that french numbers are damaged :/
Thank's for your help
was (Author: a.boujanane):
thank's you :) using ** textStripper.setSortByPosition(true) ** a text containing just Arabic or french words is correctly extracted, but not a text containing Arabic and french words, OR Arabic and french numbers:
eg: (Arabic words and french numbers)
Input
******************************
سنة 2012
شهر 07
يوم 23
سنة 2012 و شهر 07 و يوم 23
******************************
Output
*****************************
سنة 0810
شهر 80
يوم 02
سنة 0810 و شهر 80 و يوم 02
*****************************
notice that french numbers are damaged :/
Thank's for your help
> damaged arabic text after extraction from pdf
> ---------------------------------------------
>
> Key: PDFBOX-1361
> URL: https://issues.apache.org/jira/browse/PDFBOX-1361
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.7.0
> Environment: Windows 7
> Eclipse v: last release
> PDFBOX 1.7.0.jar
> icu4j-49.jar
> Reporter: amin bouja
> Labels: newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
> ***********************************************************************************|
> PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
> PDFTextStripper textStripper = new PDFTextStripper(); |
> String Text = textStripper.getText(pddDocument); |
> System.out.println(Text); |
> ***********************************************************************************
> I'am having as Output :
> 05:71 - 2102يوليوز 22األحد
> ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
> .يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
> But it should be:
> الأحد 22 يوليوز 2012 - 17:58
> أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (PDFBOX-1361) damaged arabic text after
extraction from pdf
Posted by "amin bouja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420359#comment-13420359 ]
amin bouja edited comment on PDFBOX-1361 at 7/22/12 10:59 PM:
--------------------------------------------------------------
As you can see for example, the first word " أضرم " at the second line of the input (the PDF)
is at the middle of the first line in output text
was (Author: a.boujanane):
As you can see, the first word at the first line " أضرم " of the input (the PDF)
is at the middle of the first line in output text
> damaged arabic text after extraction from pdf
> ---------------------------------------------
>
> Key: PDFBOX-1361
> URL: https://issues.apache.org/jira/browse/PDFBOX-1361
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.7.0
> Environment: Windows 7
> Eclipse v: last release
> PDFBOX 1.7.0.jar
> icu4j-49.jar
> Reporter: amin bouja
> Labels: newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
> ***********************************************************************************|
> PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
> PDFTextStripper textStripper = new PDFTextStripper(); |
> String Text = textStripper.getText(pddDocument); |
> System.out.println(Text); |
> ***********************************************************************************
> I'am having as Output :
> 05:71 - 2102يوليوز 22األحد
> ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
> .يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
> But it should be:
> الأحد 22 يوليوز 2012 - 17:58
> أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PDFBOX-1361) damaged arabic text after
extraction from pdf
Posted by "amin bouja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420611#comment-13420611 ]
amin bouja commented on PDFBOX-1361:
------------------------------------
thank's you :) using ** textStripper.setSortByPosition(true) ** a text containing just Arabic or french words is correctly extracted, but not a text containing Arabic and french words, OR Arabic and french numbers:
eg: (Arabic words and french numbers)
Input
******************************
سنة 2012
شهر 07
يوم 23
سنة 2012 و شهر 07 و يوم 23
******************************
Output
*****************************
سنة 0810
شهر 80
يوم 02
سنة 0810 و شهر 80 و يوم 02
*****************************
notice that french numbers are damaged :/
Thank's for your help
> damaged arabic text after extraction from pdf
> ---------------------------------------------
>
> Key: PDFBOX-1361
> URL: https://issues.apache.org/jira/browse/PDFBOX-1361
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.7.0
> Environment: Windows 7
> Eclipse v: last release
> PDFBOX 1.7.0.jar
> icu4j-49.jar
> Reporter: amin bouja
> Labels: newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
> ***********************************************************************************|
> PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
> PDFTextStripper textStripper = new PDFTextStripper(); |
> String Text = textStripper.getText(pddDocument); |
> System.out.println(Text); |
> ***********************************************************************************
> I'am having as Output :
> 05:71 - 2102يوليوز 22األحد
> ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
> .يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
> But it should be:
> الأحد 22 يوليوز 2012 - 17:58
> أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PDFBOX-1361) damaged arabic text after
extraction from pdf
Posted by "amin bouja (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-1361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13420359#comment-13420359 ]
amin bouja commented on PDFBOX-1361:
------------------------------------
As you can see, the first word at the first line " أضرم " of the input (the PDF)
is at the middle of the first line in output text
> damaged arabic text after extraction from pdf
> ---------------------------------------------
>
> Key: PDFBOX-1361
> URL: https://issues.apache.org/jira/browse/PDFBOX-1361
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.7.0
> Environment: Windows 7
> Eclipse v: last release
> PDFBOX 1.7.0.jar
> icu4j-49.jar
> Reporter: amin bouja
> Labels: newbie
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> I am using PDFBOX 1.7.0 with the icu4j-49.jar to extract multilingual text from a pdf file, using this code:
> ***********************************************************************************|
> PDDocument pddDocument = PDDocument.load(new File("arabic.pdf")); |
> PDFTextStripper textStripper = new PDFTextStripper(); |
> String Text = textStripper.getText(pddDocument); |
> System.out.println(Text); |
> ***********************************************************************************
> I'am having as Output :
> 05:71 - 2102يوليوز 22األحد
> ي بدنه عند محطة للحافالت، اليوم األحد، ليصاب بحروق خطيرة وذلك بعد أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار ف
> .يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل
> But it should be:
> الأحد 22 يوليوز 2012 - 17:58
> أضرم جندي إسرائيلي سابق يستخدم كرسيا متحركا النار في بدنه عند محطة للحافلات، اليوم الأحد، ليصاب بحروق خطيرة وذلك بعد يومين من وفاة محتج متأثرا باصابات ناجمة عن حادث مماثل.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira