Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 129567

Summary: BIDI3.2: [HCG] BiDi chars are not reordered in PDF report
Product: z_Archived Reporter: Tomer Mahlin <tomerm>
Component: BIRTAssignee: Yu Chen <yChen>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: bluesoldier, clin, Lina.Kemmel, mfadl, wyan, xwang
Version: 2.0.0   
Target Milestone: 2.5.0   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Display of BiDi text in PDF format none

Description Tomer Mahlin CLA 2006-02-27 08:45:50 EST
This is BiDi specific defect.

The problem stems from the fact that Acrobat reader does not invoke BiDi transformation on the document buffer before displaying it. As compared to it MS Word, Notepad do that. Consequently BiDi characters appear in it in the same order in which they are stored in the buffer, which is identical to the typing order. As you know BiDi characters should appear in the reversed order. For example if you type HELLO you expect to see OLLEH on the screen.
  To resolve this BIRT must invoke explicitly BiDI engine on the text before generating the PDF report. This can be done using IBM JDK 1.4.1 (and higher) BiDi engine.

1. Create report including BiDI text 
2. Preview it in PDF reader


Result. Pay your attention that BiDI data appears in the BIRT Eclipse reordered while in PDF report it is not reordered.

Similar problem was resolved in ITIM and WID IBM products exactly as I described above (by explicit invocation of BiDi engine on the relevant portion of text used for PDF reports generation).
Comment 1 Yu Chen CLA 2006-04-20 01:48:41 EDT
fixed
Comment 2 Tomer Mahlin CLA 2006-05-01 07:23:16 EDT
It seems that something indeed changed in the behavior but the defect has not been resolved.
  First of all a couple of new issues appeared. itext..jar file supplied with installation is invalid and can not be opened with zip. I replaced it.
  Second, NL chars appear as question marks in PDF report probably due to incorrect font.
  Finally and most importantly the reordering of BiDi string is not correct. I attach the image illustrating the case. However there are 2 cases which are apparent from the image:
  1. In the mixed BiDi string including numbers the latter are reversed (e.g. 123 appear as 321)
  2. If BiDI string include underscore (e.g. fword_sword) it is displaced in the rendered string (e.g. fword_sword is displayed as fwordsword_)

Comment 3 Tomer Mahlin CLA 2006-05-01 07:24:59 EDT
Created attachment 39920 [details]
Display of BiDi text in PDF format

Notice the difference in the relative order of bidi words in the Preview and PDF. Notice that numbers (e.g. 123) are reversed in PDF (e.g. 123 appears as 321).
Comment 4 Wenfeng Li CLA 2006-05-16 17:58:41 EDT
support BiDi layout of report in PDF involved more than just reversing the order of each word. We also need to look at chart, grid, padding and alignment etc...

Will need to research iText API's to leverage its support of BIDI.
Comment 5 Wenfeng Li CLA 2006-05-26 21:38:03 EDT
CHange to severity to be enhancement as to support BiDi in PDF output completely.
Comment 6 Tomer Mahlin CLA 2006-05-28 05:34:43 EDT
This is by all means not an enhancement. You simply can not read BiDi data in PDF report if characters are not ordered correctly. The report is simply unreadable. It is not any more a matter of convenience but a usability issue. Thus I don't think you can call it enhancement.
  You should use IBM JDK BiDi engine which produce correct results. It was used for handling similar issues with PDF in ITIM and WID IBM products.

Comment 7 Tomer Mahlin CLA 2006-05-28 05:49:52 EDT
 "Reversing the order of each word" is not correct approach here. The correct approach is to convert the text from Logical LTR to Visual LTR BiDi format before passing it to the converter. For this conversion BiDi engine should be used. This engine is available from IBM JDK. 
Comment 8 Wenfeng Li CLA 2006-05-30 16:33:21 EDT
Need to find out if the BiDi engine is in IBM JDK 1.4.1 only, or is it in other JDK as well.  We need to support commonly used JDKs.

Reason for setting this entry as enhamcenet is that supporting BiDi in PDF is a new feature to BIRT that is not planned in 2.1.0.

Comment 9 Lina Kemmel CLA 2008-07-01 09:51:50 EDT
I believe this bug was fixed in 2.3.0.
Comment 10 Lina Kemmel CLA 2008-09-05 07:06:01 EDT
Can anyone resolve and verify this bug please?

It should be fixed by a patch added to bug 228244.

In sum, there are 3 bugs supposed to be covered by this patch:

- bug 129567 (this one) 
- bug 181909 
- bug 228244.

(I would not duplicate at this point though...)
Comment 11 Yu Chen CLA 2008-10-10 03:18:55 EDT
verified.
Comment 12 Xiaodan Wang CLA 2008-12-09 02:53:38 EST
Verified in build (2.5.0.v20081209-0630).