You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by hitesh_jain <hi...@gmail.com> on 2009/02/20 09:17:55 UTC

Re: auto table column width with FOP?

Hi,

I need column width to be equal to content inside the cell for FOP output,
which is same as what we see in html by default.  

I am using FOP 0.94.

Can anybody give idea on the same.

Thanks
Hitesh 


Sidi Mohamed Idrissi Yaghir wrote:
> 
> hi mailing list,
> 
> i´ve defined a table with 3 columns, that contains blocks with a  
> dynamic content (image or text with different width) , and i want,  
> that the width of these columns will autoresized depending upon  
> contents.
> 
> Is this possible with FOP?
> 
> thnx a lot!
> 
> Simo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/auto-table-column-width-with-FOP--tp12257232p22116551.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: auto table column width with FOP?

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Same answer as to the original thread: Not implemented, yet. You have to
specify the columns explicitely.

On 20.02.2009 09:17:55 hitesh_jain wrote:
> 
> Hi,
> 
> I need column width to be equal to content inside the cell for FOP output,
> which is same as what we see in html by default.  
> 
> I am using FOP 0.94.
> 
> Can anybody give idea on the same.
> 
> Thanks
> Hitesh 
> 
> 
> Sidi Mohamed Idrissi Yaghir wrote:
> > 
> > hi mailing list,
> > 
> > i´ve defined a table with 3 columns, that contains blocks with a  
> > dynamic content (image or text with different width) , and i want,  
> > that the width of these columns will autoresized depending upon  
> > contents.
> > 
> > Is this possible with FOP?
> > 
> > thnx a lot!
> > 
> > Simo
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/auto-table-column-width-with-FOP--tp12257232p22116551.html
> Sent from the FOP - Users mailing list archive at Nabble.com.


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: auto table column width with FOP?

Posted by Georg Datterl <ge...@geneon.de>.
Hi Hitesh,

Best way I found: Calculate the string widths and define fixed column widths. And pray you don't have line breaks, subelements, blocks in blocks, multiple inlines or other strange stuff like padding, insets, borders... Here's the method I use:

    private static FOP  analyser = null;

    public float getWidthPoint2() {
        double width = 0;
         if ( analyser == null ) {
             analyser = new FOP();
         }
        Font f = getActiveFont();	// get the relevant font from somewhere...
        if (f != null) {
         try {
            width = analyser.getTextWidth( text, f.getName(), (int)Math.ceil(f.getSize()));	// text is the actual string displayed in the table cell
         } catch (Exception e) {
             e.printStackTrace();
         }
        }
        return (float) width;
    }

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: hitesh_jain [mailto:hitesh.m.jain@gmail.com] 
Gesendet: Freitag, 20. Februar 2009 09:18
An: fop-users@xmlgraphics.apache.org
Betreff: Re: auto table column width with FOP?


Hi,

I need column width to be equal to content inside the cell for FOP output, which is same as what we see in html by default.  

I am using FOP 0.94.

Can anybody give idea on the same.

Thanks
Hitesh 


Sidi Mohamed Idrissi Yaghir wrote:
> 
> hi mailing list,
> 
> i´ve defined a table with 3 columns, that contains blocks with a 
> dynamic content (image or text with different width) , and i want, 
> that the width of these columns will autoresized depending upon 
> contents.
> 
> Is this possible with FOP?
> 
> thnx a lot!
> 
> Simo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

--
View this message in context: http://www.nabble.com/auto-table-column-width-with-FOP--tp12257232p22116551.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org