Bug 43824 - RTF doesn't support proportional column widths
Summary: RTF doesn't support proportional column widths
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: rtf (show other bugs)
Version: trunk
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-09 06:47 UTC by Chris Bowditch
Modified: 2012-04-01 07:03 UTC (History)
3 users (show)



Attachments
Test FO to reproduce bug (2.44 KB, text/plain)
2007-11-09 06:48 UTC, Chris Bowditch
Details
table scaling patch (18.17 KB, patch)
2008-06-23 02:34 UTC, Max Aster
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Bowditch 2007-11-09 06:47:33 UTC
The attached FO renders very badly in RTF because it contains a lot of 
fo:table elements that use proportional-column-width function for the column 
widths. Changing the width to fixed widths produces a better result but the 
RTF renderer should support proportional-column-width function if possible
Comment 1 Chris Bowditch 2007-11-09 06:48:05 UTC
Created attachment 21102 [details]
Test FO to reproduce bug
Comment 2 Max Aster 2008-06-04 07:17:31 UTC
Inside the source code (RTFHandler) is also a comment saying that its not implemented well at the moment.
I would like to help fixing the problem.
Hints are always welcome
Comment 3 Jeremias Maerki 2008-06-05 01:26:09 UTC
Maximilian, this goes in the direction of supporting percentages in RTF output. This is mostly done in the layout managers for the page-oriented output formats, so that means it has to be recreated for the flow-based output formats. I assume some kind of tracking mechanism is necessary to have the base values for percentage-based calculations (and proportional-column-width() for that matter). If done properly this might even be useful for the layout managers at some point. Anyway, take a look at org.apache.fop.datatypes.PercentBaseContext. This interface is implemented by AbstractBaseLayoutManager. In the case of RTF, this should probably be a separate class (i.e. that tracking mechanism I mentioned above) so it can be reused by other/future flow-based output formats [1]. For the table columns, take a look at org.apache.fop.layoutmgr.table.TableLayoutManager which contains code for handling the proportional-column-width() approach. Something similar has to be done for the flow-based formats.

[1] Incidentally, I'm going to a client today to coach them for implementing ODF output support.
Comment 4 Antti Karanta 2008-06-05 02:21:06 UTC
(In reply to comment #3)

> [1] Incidentally, I'm going to a client today to coach them for implementing
> ODF output support.

  This is very interesting. Is it going to be in their use only or is it going to be published into public domain? If so, are there any time estimates when this might happen?



Comment 5 Jeremias Maerki 2008-06-05 02:53:39 UTC
I can probably tell you more tomorrow. Nothing's fixed, yet. I expect them to want to contribute this back to FOP at some point and put it under the ALv2. One of the problems is the lack of an ODF library with a compatible license. All Java ODF libraries I know of are published under the LGPL which complicates things for FOP. Timeframe: rather soon (<2 months probably).
Comment 6 Max Aster 2008-06-23 02:34:26 UTC
Created attachment 22158 [details]
table scaling patch

- column-width accepts percent values (proportional-column-width and % working)
- Table width accepts percent values (100% of the pagewidth as standard)
- nested tables are working
- it is also possible to make nested tables with a higher depth than 3 without causing word to crash
Comment 7 Jeremias Maerki 2008-07-06 08:18:07 UTC
Patch applied to 0.95 branch with modifications:
http://svn.apache.org/viewvc?rev=674304&view=rev

It's not technically bugfixing only but I thought it would be great to have that in 0.95.

Maximilian's ICLA is recorded. Thanks, Maximilian!
Comment 8 Glenn Adams 2012-04-01 07:03:32 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed