Re: [css2xslfo-support] [FOP] workarounds for xhtml table ?
Brought to you by:
wdonne
From: <wer...@re...> - 2005-06-02 15:39:27
|
Hi Matthias, You could edit the fop_filter.xsl file, which is placed between the XSL-FO generator and FOP in css2fop. You can also run css2xslfo instead of css2fop and launch an XSLT processor with a post-processing style sheet. In the coming version the fop_filter.xsl will be extended to cover more cases, especially for tables. The line-height and font-size properties can also be added in your CSS style sheet. Calculating column widths is a way to compensate for not having automatic table layout, but it can only be an approximation, because you have no access to font metrics, etc. I would translated the calculation in proportional widths for the columns. That works with FOP. Such calculations would have to be done in Java. Adding something to CSSToXSLFO is an option, but an unsafe one with respect to upgrades. You can also do it on the XSL-FO document in a Java XML filter. You can then create a new wrapper, with a main method, that has an XMLFilter chain of two entries: be.re.css.CSSToXSLFOFilter first and your filter second. Best regards, Werner. Matthias Wessendorf wrote: > Werner, > > I saw that html2fo (C based) is able to generate a FO that works fine > with FOP. their tables need to <colgroup> etc. > > They are calculating the width and also each <fo:block/> has > those attributes. > > <fo:block line-height="12pt" font-size="10pt" space-before.optimum="1.5pt" space-after.optimum="1.5pt" keep-together="always"> > > keep-allways allows the text to be rendered inside a column of that table. > > Can you tell me the java file, where I could add something like that ? > ` > Or do you know a *patch* for stuff like that? > > Thanks, > Matthias > > >>-----Original Message----- >>From: Werner Donné [mailto:wer...@re...] >>Sent: Thursday, June 02, 2005 11:04 AM >>To: Matthias Wessendorf >>Cc: css...@li... >>Subject: Re: [css2xslfo-support] [FOP] workarounds for xhtml table ? >> >> >>Hi Matthias, >> >>You should add a "col" element to your table with the "width" >>attribute set to something. In this case the value I propose >>is "1*", which indicates the column will occupy the complete >>table. >> >>Regards, >> >>Werner. >> >>Matthias Wessendorf wrote: >> >>>Hi, >>> >>>I come back to css2xslfo. I have currently the problem, >> >>that I need to generate a PDF that >> >>>contains a xhtml table. >>> >>>my xhtml is >>> >>><?xml version="1.0"?> >>><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >>><html xmlns="http://www.w3.org/1999/xhtml"> >>><head> >>><title>Foo</title> >>><style type="text/css"> >>> >>>body, h1, h2, h3, p, div, ol, li, table, thead, tbody, th, tr, td { >>> hyphenate: false; >>>} >>> >>> >>></style> >>></head> >>><body> >>> >>><table> >>> <thead> >>> <tr> >>> <th>User</th> >>> </tr> >>> </thead> >>> <tbody> >>> <tr> >>> <td> >>> MW >>> </td> >>> </tr> >>> </tbody> >>></table> >>> >>></body> >>></html> >>> >>> >>> >>> >>> >>> >>> >>>I guess it is valid. But the FOP tells me: >>> >>>[INFO] building formatting object tree >>>[INFO] setting up fonts >>>[ERROR] property - "text-transform" is not implemented yet. >>>[ERROR] property - "text-transform" is not implemented yet. >>>[INFO] [1] >>>[WARNING] table-layout=auto is not supported, using fixed! >>>[WARNING] current implementation of tables requires a >> >>table-column for each column, indicating column-width >> >>>[INFO] Parsing of document complete, stopping renderer >>> >>> >>>and the PDF is blank, no table there :-( >>> >>>Does anybody know a workaround to output that table using FOP ? >>> >>>Thanks, >>>Matthias >>> >>> >>> >>>------------------------------------------------------- >>>This SF.Net email is sponsored by Yahoo. >>>Introducing Yahoo! Search Developer Network - Create apps >> >>using Yahoo! >> >>>Search APIs Find out how you can build Yahoo! directly into your own >>>Applications - visit > > http://developer.yahoo.net/?fr_______________________________________________ > >>css2xslfo-support mailing list >>css...@li... >>https://lists.sourceforge.net/lists/listinfo/css2xslfo-support >> >> > > -- Werner Donné -- Re BVBA Engelbeekstraat 8 B-3300 Tienen tel: (+32) 486 425803 e-mail: wer...@re... |