Bug 404033 - valid HTML markup not interpreted properly for PDF output
Summary: valid HTML markup not interpreted properly for PDF output
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 4.2.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-21 10:52 EDT by Donald Hayes CLA
Modified: 2013-03-25 11:09 EDT (History)
1 user (show)

See Also:


Attachments
simple rptdesign file that displays the issue (3.31 KB, application/octet-stream)
2013-03-21 10:53 EDT, Donald Hayes CLA
no flags Details
stack dump produces when processing the rptdesign file through the API (13.72 KB, text/plain)
2013-03-21 10:54 EDT, Donald Hayes CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Donald Hayes CLA 2013-03-21 10:52:35 EDT
A report which contains a dynamic text element which will be interpreted as HTML fails to properly parse and render some valid HTML style constructs when producing PDF output.  The same HTML content works properly for HTML output.  This particular case is when a style uses "rgb(x, y, z)" to define a color component of the style, and it is due to having spaces (which are legal HTML syntax) between the three parameters of the rgb call.  That is, if the markup is changed to be "rgb(x,y,z)" it will work properly.  There is also a non-fatal stack dump produced when the rgb call with spaces is used (see attached file).

The attached rptdesign file is a stripped down version which reproduces the problem.

Reproducible: Always

Steps to Reproduce:
1. Open the rptdesign file in the standalone BIRT report designer
2. Run->View Report->HTML
3. Note that the box surrounding the text is red.
4. Run->View Report->PDF
5. Note that the box surrounding the text is black, not red as specified.
Comment 1 Donald Hayes CLA 2013-03-21 10:53:13 EDT
Created attachment 228852 [details]
simple rptdesign file that displays the issue
Comment 2 Donald Hayes CLA 2013-03-21 10:54:17 EDT
Created attachment 228853 [details]
stack dump produces when processing the rptdesign file through the API
Comment 3 Xiaoying Gu CLA 2013-03-22 05:57:59 EDT
You can try "border: 1pt solid red" in the HTML.
currently PDf does not support rgb(255, 0, 0) setting.
Comment 4 Donald Hayes CLA 2013-03-25 11:09:21 EDT
In our production environment, the dynamic text boxes contain HTML markup from our customer base so we cannot simply change the color description to "red".

Also, the rgb setting does work for PDF output but only if there are no spaces in the entry.  That is "rgb(255, 0, 0)" fails but "rgb(255,0,0)" works.  I looked briefly at the source code and the parser was splitting CSS items by the space character which is what causes the issue in this case because it ends up sending "rgb(255," then "0,", and "0)" down to the CSS processor.

If necessary, please consider this an enhancement request.  At the very least, it would be nice to avoid the complete stack dump when this error is encountered.