Re: Reading RTF table in Word

Dominique Schoenenberger <[email protected]> Wed, 24 Nov 2004 06:32:22 +0100
Newsgroups gmane.text.xml.jfor.general
Message-ID <[email protected]>
--Apple-Mail-2-560574633
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

At first hand, the easiest solution to this problem seems to avoid 
column-span and slip your table into different tables having different 
number of columns.

I try this and it really solve the problem for Word 2002 but I have now 
a problem when opening my document in Word 2000: It take so much time 
to open ... something like 5 min ! instead of 10-20s I had before. If 
you are very patient and you wait until you can reach the end of the 
document, you may save it and afterwards it will open with the normal 
speed !! (I'm on Windows)

My problem is that the generated document will be open by persons 
working on Windows 2000 or Windows XP and they will give copy of the 
document each other. So, to solve the problem, I think we really need 
to find the way to generate column-span understandable by the 2 
Wor(l)ds (if it exists some way ?).

Someone did try this ?

Dominique

On Nov 24, 2004, at 6:11 AM, Dominique Schoenenberger wrote:

> Thanks Phil,
>
> I may look at it again. However, my novice reading of the rtf file 
> that was
> produced was that the offsets that were specified were correct. In 
> fact word
> 2000 rendered it correctly.  Word 2002 did not. Even in 2002, most of 
> the
> number-columns-spanned attribute seemed to work except in a few cases. 
> My
> very quick interpretation of what word did to the rtf was that word was
> incorrect.
>
> Vincent
> ----- Original Message -----
> From: "Phil Chu" <philipchu <at> technicat.com>
> To: <vhikida <at> inreach.com>
> Cc: <jfor-users <at> lists.sourceforge.net>
> Sent: Monday, September 13, 2004 11:31 PM
> Subject: Re: [jfor-users] re: Reading RTF table in Word
>
>
> > This may not have anything to do with what you're seeing, but I'm 
> sure
> > the table cell spacing produced by JFOR is not always correct, 
> because I
> > introduced some code last year that is not always correct (my code to
> > handle proportional-column-width for table columns uses a hard-coded
> > total table width, because I couldn't figure out how to derive the 
> real
> > width easily).
> >
> > I seem to remember that the there is a spanning-column case in the 
> test
> > suite included in the jfor distribution, so you could check if that
> > example works for you.
> >
> > If you can pin down what jfor should and shouldn't be generating in 
> your
> > test case, then a motivated individual (perhaps you!) might dive into
> > the code and fix it. Good luck!
> >
> > -Phil
> >
> > vhikida <at> inreach.com wrote:
> >
> > > For reference, I did find a workaround for my problem. Word does 
> not
> > > always like rtf output from jfor when using <fo:table-cell
> > > number-columns-spanned="n"> The workaround is to create a new table
> > > whenever columns need to be spanned.
> > >
> > > I also found a rtf specification and tried to read the rtf file 
> produced
> > > by jfor and what word does when it reads it. I only looked at the 
> code
> > > briefly so I am not sure I understood everything correctly. JFOR 
> uses an
> > > rtf code that specifies the offset of the left edge of each cell. 
> There
> is
> > > also an rtf code that specifies when one cell should be merged to 
> with
> the
> > > next whenever jfor finds a number-columns-spanned attribute.
> > >
> > > Word keeps the rtf code that jfor produces but it also seems to 
> put in
> > > redundant code that specifies the length of each cell (redundant 
> because
> > > you can find the size of the cell by subtracting offsets). When 
> columns
> > > are spanned Word does not seem to put in the correct cell size so
> although
> > > the offsets are still specified correctly cell size is not.
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> > > Project Admins to receive an Apple iPod Mini FREE for your 
> judgement on
> > > who ports your project to Linux PPC the best. Sponsored by IBM.
> > > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> > > _______________________________________________
> > > jfor-users mailing list
> > > jfor-users <at> lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/jfor-users
> > >
> >
> >
> > --
> > Phil Chu
> > philipchu <at> technicat.com
> > http://www.technicat.com/
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> > Project Admins to receive an Apple iPod Mini FREE for your judgement 
> on
> > who ports your project to Linux PPC the best. Sponsored by IBM.
> > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> > _______________________________________________
> > jfor-users mailing list
> > jfor-users <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jfor-users
> >
> >
--Apple-Mail-2-560574633
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

At first hand, the easiest solution to this problem seems to avoid
column-span and slip your table into different tables having different
number of columns.


I try this and it really solve the problem for Word 2002 but I have
now a problem when opening my document in Word 2000: It take so much
time to open ... something like 5 min ! instead of 10-20s I had
before. If you are very patient and you wait until you can reach the
end of the document, you may save it and afterwards it will open with
the normal speed !! (I'm on Windows)


My problem is that the generated document will be open by persons
working on Windows 2000 or Windows XP and they will give copy of the
document each other. So, to solve the problem, I think we really need
to find the way to generate column-span understandable by the 2
Wor(l)ds (if it exists some way ?).


Someone did try this ?


Dominique


On Nov 24, 2004, at 6:11 AM, Dominique Schoenenberger wrote:


<excerpt><fontfamily><param>Courier</param><x-tad-bigger>Thanks Phil,


I may look at it again. However, my novice reading of the rtf file
that was

produced was that the offsets that were specified were correct. In
fact word

2000 rendered it correctly.  Word 2002 did not. Even in 2002, most of
the

number-columns-spanned attribute seemed to work except in a few cases.
My

very quick interpretation of what word did to the rtf was that word was

incorrect.


Vincent

----- Original Message -----

From: "Phil Chu" <<philipchu <<at> technicat.com>

To: <<vhikida <<at> inreach.com>

Cc: <<jfor-users <<at> lists.sourceforge.net>

Sent: Monday, September 13, 2004 11:31 PM

Subject: Re: [jfor-users] re: Reading RTF
</x-tad-bigger><bold><x-tad-bigger>table</x-tad-bigger></bold><x-tad-bigger>
in Word



> This may not have anything to do with what you're seeing, but I'm
sure

> the
</x-tad-bigger><bold><x-tad-bigger>table</x-tad-bigger></bold><x-tad-bigger> cell
spacing produced by JFOR is not always correct, because I

> introduced some code last year that is not always correct (my code to

> handle proportional-column-width for
</x-tad-bigger><bold><x-tad-bigger>table</x-tad-bigger></bold><x-tad-bigger>
columns uses a hard-coded

> total
</x-tad-bigger><bold><x-tad-bigger>table</x-tad-bigger></bold><x-tad-bigger> width,
because I couldn't figure out how to derive the real

> width easily).

>

> I seem to remember that the there is a spanning-column case in the
test

> suite included in the jfor distribution, so you could check if that

> example works for you.

>

> If you can pin down what jfor should and shouldn't be generating in
your

> test case, then a motivated individual (perhaps you!) might dive into

> the code and fix it. Good luck!

>

> -Phil

>

> vhikida <<at> inreach.com wrote:

>

> > For reference, I did find a workaround for my problem. Word does
not

> > always like rtf output from jfor when using
<<fo:</x-tad-bigger><bold><x-tad-bigger>table</x-tad-bigger></bold><x-tad-bigger>-cell

> > number-columns-spanned="n"> The workaround is to create a new
</x-tad-bigger><bold><x-tad-bigger>table</x-tad-bigger></bold><x-tad-bigger>

> > whenever columns need to be spanned.

> >

> > I also found a rtf specification and tried to read the rtf file
produced

> > by jfor and what word does when it reads it. I only looked at the
code

> > briefly so I am not sure I understood everything correctly. JFOR
uses an

> > rtf code that specifies the offset of the left edge of each cell.
There

is

> > also an rtf code that specifies when one cell should be merged to
with

the

> > next whenever jfor finds a number-columns-spanned attribute.

> >

> > Word keeps the rtf code that jfor produces but it also seems to
put in

> > redundant code that specifies the length of each cell (redundant
because

> > you can find the size of the cell by subtracting offsets). When
columns

> > are spanned Word does not seem to put in the correct cell size so

although

> > the offsets are still specified correctly cell size is not.

> >

> >

> >

> >

> > -------------------------------------------------------

> > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170

> > Project Admins to receive an Apple iPod Mini FREE for your
judgement on

> > who ports your project to Linux PPC the best. Sponsored by IBM.

> > Deadline: Sept. 13. Go here:
</x-tad-bigger><bold><color><param>0000,2322,908F</param><x-tad-bigger>http://sf.net/ppc_contest.php</x-tad-bigger></color></bold><x-tad-bigger>

> > _______________________________________________

> > jfor-users mailing list

> > jfor-users <<at> lists.sourceforge.net

> >
</x-tad-bigger><bold><color><param>0000,2322,908F</param><x-tad-bigger>https://lists.sourceforge.net/lists/listinfo/jfor-users</x-tad-bigger></color></bold><x-tad-bigger>

> >

>

>

> --

> Phil Chu

> philipchu <<at> technicat.com

>
</x-tad-bigger><bold><color><param>0000,2322,908F</param><x-tad-bigger>http://www.technicat.com/</x-tad-bigger></color></bold><x-tad-bigger>

>

>

> -------------------------------------------------------

> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170

> Project Admins to receive an Apple iPod Mini FREE for your judgement
on

> who ports your project to Linux PPC the best. Sponsored by IBM.

> Deadline: Sept. 13. Go here:
</x-tad-bigger><bold><color><param>0000,2322,908F</param><x-tad-bigger>http://sf.net/ppc_contest.php</x-tad-bigger></color></bold><x-tad-bigger>

> _______________________________________________

> jfor-users mailing list

> jfor-users <<at> lists.sourceforge.net

>
</x-tad-bigger><bold><color><param>0000,2322,908F</param><x-tad-bigger>https://lists.sourceforge.net/lists/listinfo/jfor-users</x-tad-bigger></color></bold><x-tad-bigger>

>

></x-tad-bigger></fontfamily></excerpt>
--Apple-Mail-2-560574633--



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/