xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Datterl <gdatt...@geneon.de>
Subject AW: AW: AW: Table height issue
Date Fri, 05 Feb 2010 11:44:10 GMT
Hi Ronnie,

I run the Document object through

    public static String toString(Document document) throws TransformerException {
        StringWriter stringWriter = new StringWriter();
        StreamResult streamResult = new StreamResult(stringWriter);
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer();
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
        transformer.setOutputProperty(OutputKeys.METHOD, "xml");
        transformer.transform(new DOMSource(document.getDocumentElement()), streamResult);
        return stringWriter.toString();
    }

and copy the resulting String into XMLSpy.

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: rOnnie974 [mailto:ronnie.baret@gmail.com]
Gesendet: Freitag, 5. Februar 2010 12:29
An: fop-users@xmlgraphics.apache.org
Betreff: Re: AW: AW: Table height issue


THANK YOU for your complete answer !

Before you answered me, I made some researchs and succeeded in generating an area tree file.

Now I have to understand this file, and, before, to indent it ! FOP made a file with the entire
code in one line ! xD

Thank you again.


Georg Datterl-2 wrote:
>
> Hi Ronnie,
>
> Basically (and simplified), in my case I have two colums and the
> shorter columns has to be extended. So I build my table with one block
> in each column. Each block is marked by an id. Then I serialize my
> table into a fo file and generate the area tree, an intermediate
> format between fo and pdf. This format is an xml tree with all the
> basic informations like page, column and line breaks, size of areas
> and so on. I search for the marked blocks, get their height and
> compare. Then I extend the smaller block in my original table and
> serialize again. Now I can generate the PDF and both columns have the same height.
>
> Problems:
> * I have to generate the area tree for each table. That takes some time.
> * One of my blocks contains a table, which gives basically
> unpredictable results if split over more than two pages.
> * What should happen if there's a page break after one column is
> already finished? In that case you won't find the block on the second
> page and extending the block might change the break position and then
> the calculated block height is incorrect.
>
> You should make REALLY sure you REALLY need that feature.
>
> http://markmail.org/search/?q=georg.datterl+from%3A%22Georg+Datterl%22
> +list%3Aorg.apache.xmlgraphics.fop-users+type%3Ausers+date%3A200804-20
> 1002++table
>
> that should give you a list of my postings talking about tables. Read
> at you own peril. :-)
>
> You can get the area tree with this code:
>
>             FopFactory fopFactory = FopFactory.newInstance();
>                 fopFactory.setUserConfig(new File("fonts/fop.xconf"));
>             FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
>             SAXTransformerFactory mpFactory =
> (SAXTransformerFactory)SAXTransformerFactory.newInstance();
>             Transformer transformer =  mpFactory.newTransformer();
>             TransformerHandler handler =
> mpFactory.newTransformerHandler();
>             DOMResult domResult = new DOMResult();
>             handler.setResult(domResult);
>
>             org.apache.fop.render.Renderer targetRenderer =
>             foUserAgent.getRendererFactory().createRenderer(
>                             foUserAgent, MimeConstants.MIME_PDF);
>
>             XMLRenderer renderer = new XMLRenderer();
>             renderer.mimicRenderer(targetRenderer);
>             renderer.setContentHandler(handler);
>             renderer.setUserAgent(foUserAgent);
>
>             foUserAgent.setRendererOverride(renderer);
>
>             Fop fop = fopFactory.newFop(foUserAgent);
>             Result res = new SAXResult(fop.getDefaultHandler());
>             transformer.transform(source, res);  // source is a
> StreamSource containing the fo file
>             return  (org.w3c.dom.Document)domResult.getNode();
>
> Hope that helps.
>
> 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: rOnnie974 [mailto:ronnie.baret@gmail.com]
> Gesendet: Freitag, 5. Februar 2010 11:43
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: AW: Table height issue
>
>
> Thanks for your answer Georg.
>
> I did not find the threads you are talking about.
>
>> I create the table, parse the area tree and then insert empty blocks
>> with a calculated height to simulate that.
> Could you please explain me how to do that ? I am a beginner and do
> not know what area trees are.
>
> Thanks you in advance.
>
>
>
> Georg Datterl-2 wrote:
>>
>> Hi Ronnie,
>>
>>> Does not exist an attribute that would say to my table to extend it
>>> until there is no more available area on the last page ?
>>
>> Trust me, there is none. I create the table, parse the area tree and
>> then insert empty blocks with a calculated height to simulate that.
>> You can search the archive for threads I started, many of them deal
>> with exactly that problem...
>>
>> 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: rOnnie974 [mailto:ronnie.baret@gmail.com]
>> Gesendet: Freitag, 5. Februar 2010 05:32
>> An: fop-users@xmlgraphics.apache.org
>> Betreff: Re: Table height issue
>>
>>
>> Hi,
>>
>> Thanks for your answer.
>>
>> Unfortunately, as I said, I write directly in XSL FO. It was simplier
>> for me to have the design I want, but perhaps I made a mistake.
>>
>> Moreover, the height of each quote can change as they can have a
>> bigger description. Another difficulty is that the document can be
>> extended on several pages, and the header do not have to be repeated.
>> So the last page can be different than if it has only one.
>>
>> Does not exist an attribute that would say to my table to extend it
>> until there is no more available area on the last page ?
>>
>>
>> Venkat Reddy-7 wrote:
>>>
>>> Hi,
>>>
>>> May be, you can acheive this using your xslt file.
>>> I hope, you are using XSLT + XML to generate XSL:FO file.
>>> You can check the number of rows under each quote while generating
>>> the FO file, add the extra empty rows or increase the height of the
>>> last row when the script finds less no.of rows.
>>>
>>> Hope this will help you,
>>> Venkat.
>>>
>>> rOnnie974 wrote:
>>>> I am using the trunk version of FOP.
>>>>
>>>> here is a pdf I generated.
>>>>
>>>> https://www.yousendit.com/download/S1VEaUNGaTFoMlVLSkE9PQ
>>>> (available
>>>> 7
>>>> days)
>>>>
>>>> I want that the second table can be extended to fill the entire page.
>>>>
>>>>
>>>> Venkat Reddy-7 wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Can you please provide an example doc what you are looking for?
>>>>> and also mention the version you are using...
>>>>>
>>>>> Thanks,
>>>>> Venkat.
>>>>>
>>>>> rOnnie974 wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I make quote documents by writing directly in XSL-FO with a XML
>>>>>> behind.
>>>>>>
>>>>>> The number of rows is variable from one quote to another, so I
>>>>>> have to put some blank rows at the end of the table body before
>>>>>> the footer, so that the table takes the entire page.
>>>>>>
>>>>>> How can I make it dynamically ? Or do you see another solution to
>>>>>> this issue ?
>>>>>>
>>>>>> Thanks in advance.
>>>>>>
>>>>>> Ronnie Baret
>>>>>>
>>>>>>
>>>>> ------------------------------------------------------------------
>>>>> -
>>>>> -
>>>>> - 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
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Table-height-issue-tp27451583p27463438.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
>>
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/Table-height-issue-tp27451583p27466097.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
>
>
>

--
View this message in context: http://old.nabble.com/Table-height-issue-tp27451583p27466541.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


Mime
View raw message