You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by vadim <va...@swissonline.ch> on 2005/08/04 18:43:02 UTC

ugly tables in PDF files

Hallo everybody,

Do you know what is the reason to generate tables in PDF files of fixed
width and fixed (probably hardcoded) column width? Tables look really
ugly! Do you know if I can adjust something somewhere to get tables in
PDF files to look better?

Best regards, vadim tarassov.
-- 
vadim <va...@swissonline.ch>


Re: ugly tables in PDF files

Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> Neil Troy wrote:
> >vadim wrote:
> >
> >>Do you know what is the reason to generate tables in PDF files of fixed
> >>width and fixed (probably hardcoded) column width? Tables look really
> >>ugly! Do you know if I can adjust something somewhere to get tables in
> >>PDF files to look better?
> 
> FOP (or FO rendering engine) does not support tables that auto size. see 
> http://xml.apache.org/fop/compliance.html#fo-object-table
> 
> >I needed to fix some tables quick.  
> 
> Professional patches welcome ;-)
> 
> You could count the chars in a all the cells then allocate the space 
> accordingly. This would work better but would have problems with tables 
> that involved images.
> 
> See the files in FORREST_HOME/main/skins/common/xslt/fo/

We have not done very much work to enhance our use of
Apache FOP to transform the docs to PDF. Our stylesheets
are just a beginning. Someone would need to explore
the many powers of FOP and then enhance our xslt/fo/*.xsl

Also people could go to help the Apache FOP community
to find ways to deal with such issues.
http://xml.apache.org/fop/

Anyway please join us on the Forrest dev mailing list
if you wnat to purue this beyond the user level.

David

Re: ugly tables in PDF files

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ross Gardler a écrit :

> vadim wrote:
>
>> Do you think it would good idea to introduce an attribute to <th>
>> element, whose value will indicate width of the column, for example, in
>> percent from the total width?
>
>
> My own view on this is that since Forrest is intended to provide 
> output in many different output formats a width attribute is a 
> dangerous thing. When it translates to, for example, a small screen it 
> can make a table look awful (not that they look good with the current 
> solution).
>
> I would rather see output stylesheets optimising the use of the page 
> accoring to the output medium. This means improving on the existing 
> calculation algorithm.
>
> Other devs may not agree though, they may say "but a width attribute 
> is vey quick and very easy, and an output plugin could choose to 
> ignore it if it wanted to".
>
> What do people think?

I am working on using java classes in stylesheets in order to measure 
images - which are not displayed in pdf if too large - or texts size.
IMHO, I really think that we can improve output stylesheets existing 
calculation algorithm without adding any attributes in the sources.

Cyriaque,

>
> Ross
>
>>
>> Best regards, vadim tarassov.
>>
>> On Thu, 2005-08-04 at 23:16 +0100, Ross Gardler wrote:
>>
>>> Neil Troy wrote:
>>>
>>>> vadim wrote:
>>>>
>>>>
>>>>> Hallo everybody,
>>>>>
>>>>> Do you know what is the reason to generate tables in PDF files of 
>>>>> fixed
>>>>> width and fixed (probably hardcoded) column width? Tables look really
>>>>> ugly! Do you know if I can adjust something somewhere to get 
>>>>> tables in
>>>>> PDF files to look better?
>>>>
>>>
>>> FOP (or FO rendering engine) does not support tables that auto size. 
>>> see http://xml.apache.org/fop/compliance.html#fo-object-table
>>>
>>>
>>>> I needed to fix some tables quick.  
>>>
>>>
>>> Professional patches welcome ;-)
>>>
>>> You could count the chars in a all the cells then allocate the space 
>>> accordingly. This would work better but would have problems with 
>>> tables that involved images.
>>>
>>> See the files in FORREST_HOME/main/skins/common/xslt/fo/
>>>
>>> Ross
>>
>
>

Re: ugly tables in PDF files

Posted by Ross Gardler <rg...@apache.org>.
vadim wrote:
> Do you think it would good idea to introduce an attribute to <th>
> element, whose value will indicate width of the column, for example, in
> percent from the total width?

My own view on this is that since Forrest is intended to provide output 
in many different output formats a width attribute is a dangerous thing. 
When it translates to, for example, a small screen it can make a table 
look awful (not that they look good with the current solution).

I would rather see output stylesheets optimising the use of the page 
accoring to the output medium. This means improving on the existing 
calculation algorithm.

Other devs may not agree though, they may say "but a width attribute is 
vey quick and very easy, and an output plugin could choose to ignore it 
if it wanted to".

What do people think?

Ross

> 
> Best regards, vadim tarassov.
> 
> On Thu, 2005-08-04 at 23:16 +0100, Ross Gardler wrote:
> 
>>Neil Troy wrote:
>>
>>>vadim wrote:
>>>
>>>
>>>>Hallo everybody,
>>>>
>>>>Do you know what is the reason to generate tables in PDF files of fixed
>>>>width and fixed (probably hardcoded) column width? Tables look really
>>>>ugly! Do you know if I can adjust something somewhere to get tables in
>>>>PDF files to look better?
>>
>>FOP (or FO rendering engine) does not support tables that auto size. see 
>>http://xml.apache.org/fop/compliance.html#fo-object-table
>>
>>
>>>I needed to fix some tables quick.  
>>
>>Professional patches welcome ;-)
>>
>>You could count the chars in a all the cells then allocate the space 
>>accordingly. This would work better but would have problems with tables 
>>that involved images.
>>
>>See the files in FORREST_HOME/main/skins/common/xslt/fo/
>>
>>Ross


Re: ugly tables in PDF files

Posted by vadim <va...@swissonline.ch>.
Hi Ross,

Do you think it would good idea to introduce an attribute to <th>
element, whose value will indicate width of the column, for example, in
percent from the total width?

Would it be professional enough patch?

Best regards, vadim tarassov.

On Thu, 2005-08-04 at 23:16 +0100, Ross Gardler wrote:
> Neil Troy wrote:
> > vadim wrote:
> > 
> >> Hallo everybody,
> >>
> >> Do you know what is the reason to generate tables in PDF files of fixed
> >> width and fixed (probably hardcoded) column width? Tables look really
> >> ugly! Do you know if I can adjust something somewhere to get tables in
> >> PDF files to look better?
> 
> FOP (or FO rendering engine) does not support tables that auto size. see 
> http://xml.apache.org/fop/compliance.html#fo-object-table
> 
> > I needed to fix some tables quick.  
> 
> Professional patches welcome ;-)
> 
> You could count the chars in a all the cells then allocate the space 
> accordingly. This would work better but would have problems with tables 
> that involved images.
> 
> See the files in FORREST_HOME/main/skins/common/xslt/fo/
> 
> Ross
-- 
vadim <va...@swissonline.ch>


Re: ugly tables in PDF files

Posted by Ross Gardler <rg...@apache.org>.
Neil Troy wrote:
> vadim wrote:
> 
>> Hallo everybody,
>>
>> Do you know what is the reason to generate tables in PDF files of fixed
>> width and fixed (probably hardcoded) column width? Tables look really
>> ugly! Do you know if I can adjust something somewhere to get tables in
>> PDF files to look better?

FOP (or FO rendering engine) does not support tables that auto size. see 
http://xml.apache.org/fop/compliance.html#fo-object-table

> I needed to fix some tables quick.  

Professional patches welcome ;-)

You could count the chars in a all the cells then allocate the space 
accordingly. This would work better but would have problems with tables 
that involved images.

See the files in FORREST_HOME/main/skins/common/xslt/fo/

Ross

Re: ugly tables in PDF files

Posted by Neil Troy <tr...@ece.utk.edu>.
vadim wrote:

>Hallo everybody,
>
>Do you know what is the reason to generate tables in PDF files of fixed
>width and fixed (probably hardcoded) column width? Tables look really
>ugly! Do you know if I can adjust something somewhere to get tables in
>PDF files to look better?
>
>Best regards, vadim tarassov.
>  
>
Warning, this is at best a hack, at worst it is probably an amateurish 
and unprofessional thing to do. 

I needed to fix some tables quick.  Someone can correct me if I am 
mistaken, when your pages get processed, the maximum number of columns 
is found for your table, and then their width is set as the total width 
of the printable area divided by the number of columns. 

All my tables normally use the <th> tag at the top.  What I do is create 
a second row underneath this, and have 10 <th></th>, then I make sure 
all my <th>'s and <td>'s use the appropriate colspan.  This only gave me 
the granularity  of specifying within 10% width, but it gave me enough 
control to do what I needed.   Luckily the empty row of <th>'s is not 
noticeable depending on how your colors are configured.

There is probably a better way, using xslt, but I had to resort to this 
method for the short term.


Note I am using version 0.6 with document v20

Neil Troy