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 An...@picturemaxx.com on 2010/09/28 08:58:35 UTC

Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
	<fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
		<fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
	</fo:static-content>
	<fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
		<fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
	</fo:static-content>
    <fo:flow flow-name="xsl-region-body">
		<fo:block-container width="100%" background-color="#eeeeee">
			<fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
				<fo:block>4</fo:block>
			</fo:block-container>
		</fo:block-container>
		<fo:block-container width="100%" background-color="#eeeeee">
			<fo:block>5</fo:block>
			<fo:block>6</fo:block>
			<fo:block>7</fo:block>
		</fo:block-container>
		<fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
			<fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
				<fo:block>8</fo:block>
			</fo:block-container>
		</fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

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


Re: AW: Height of a block-container with absolutely positioned children

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Andreas,
this approach won't work, since the nested block-containers (absolutely
positioned) will not affect the size of the parent block-container
because it's taken out of the flow.

See: http://www.w3.org/TR/xsl11/#absolute-position

The only thing you could try is using fo:block with positive and
negative start-indent, end-indent, space-before and space-after. But I
don't think that'll work reliably in every case.

IMO, trying to force the design approach from MS Access onto XSL-FO is
a fruitless endeavour. You won't get happy. The only thing you could do
is write your own report engine in the background and generate FOP's
intermediate format. That way, you can at least re-use FOP's output
formats.

On 29.09.2010 12:08:50 Andreas.Zehender wrote:
> Hi,
> 
> to illustrate what we do exactly, please have a look at the following screenshot:
> http://development.picturemaxx.com/report/report_generator.png
> 
> If you already used the report generator of MS Access, that's quite similar.
> 
> The user can position fields taken from sql records within a block of data. This block is repeated for every sql row in recordset. The user has now two possibilities, set a fixed height of the block, or let the block expand to the height of the contents. The field "Additional Text" may span multiple lines dependent on the contents of the sql row.
> 
> The only way we found to position fields within a block is the hierarchical use of block-containers with absolute positioning, with the downside of the described behavior, that the top level block-container doesn't have a height. Maybe we used the wrong method, but the only alternative with float related properties are not supported by fop.
> 
> Any other ideas?
> 
> Best,
> Andreas
<snip/>


Jeremias Maerki


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


AW: Height of a block-container with absolutely positioned children

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

I still don't get it. If your user can position the fields anywhere he wants, he will always risk placing a field over a second field. If growing fields can only be placed in the bottom row, you could use one block per database record and place the fields in relation to this block, not in relation to the page.
 Usually blocks without explicit height get the height required by their children. Your main problem seems to be with the blocks outside of the flow and I still don't get why they have to be outside.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Mittwoch, 29. September 2010 12:09
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

to illustrate what we do exactly, please have a look at the following screenshot:
http://development.picturemaxx.com/report/report_generator.png

If you already used the report generator of MS Access, that's quite similar.

The user can position fields taken from sql records within a block of data. This block is repeated for every sql row in recordset. The user has now two possibilities, set a fixed height of the block, or let the block expand to the height of the contents. The field "Additional Text" may span multiple lines dependent on the contents of the sql row.

The only way we found to position fields within a block is the hierarchical use of block-containers with absolute positioning, with the downside of the described behavior, that the top level block-container doesn't have a height. Maybe we used the wrong method, but the only alternative with float related properties are not supported by fop.

Any other ideas?

Best,
Andreas


------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Mittwoch, 29. September 2010 09:41
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

OK, then why do you use absolute positioning? A simple flow of blocks should do exactly what you need.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Mittwoch, 29. September 2010 08:45
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

I don't think you got the problem.

The example renders as follows:

-----------------
5      |
6      |   4
7      |
-----------------

           8

-----------------

Block 4 has no height, so 5 6 7 are rendered at same place.

What we expect is, that block 4 gets exactly the height of its contents, so the result would be


-----------------

           4
-----------------
5
6
7
-----------------

           8

-----------------


Are there any other methods to create overlaying regions?

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:57
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

What about a table with two cells, one cell with 5-7, second cell with 4? Block 8 starts after the table.

Mit freundlichen Grüßen

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 09:47
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

thanks for the quick reply, but that doesn't solve my problem. I know that block 4 is behind 5-7, because the surrounding block-container has no height. What I want to achieve is, that the top level block container has automatically the height of the contents. In the example below 1.5cm. In this example, the height is known, but there may be cases where a block contains long texts which may span multiple lines, where we don't know in advance how much space is used.

<fo:block-container width="100%" background-color="#eeeeee">
  <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
    <fo:block>4</fo:block>
   </fo:block-container>
</fo:block-container>

In php/css we would append a <br clear="all" />, which forces the flow to continue below all previous elements, but a <fo:block clear="both" /> doesn't have any impact on the height in fop.

Btw: We use fop 1.0

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY


-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:25
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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



---------------------------------------------------------------------
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



---------------------------------------------------------------------
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


AW: Height of a block-container with absolutely positioned children

Posted by An...@picturemaxx.com.
Hi,

to illustrate what we do exactly, please have a look at the following screenshot:
http://development.picturemaxx.com/report/report_generator.png

If you already used the report generator of MS Access, that's quite similar.

The user can position fields taken from sql records within a block of data. This block is repeated for every sql row in recordset. The user has now two possibilities, set a fixed height of the block, or let the block expand to the height of the contents. The field "Additional Text" may span multiple lines dependent on the contents of the sql row.

The only way we found to position fields within a block is the hierarchical use of block-containers with absolute positioning, with the downside of the described behavior, that the top level block-container doesn't have a height. Maybe we used the wrong method, but the only alternative with float related properties are not supported by fop.

Any other ideas?

Best,
Andreas


------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de] 
Gesendet: Mittwoch, 29. September 2010 09:41
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

OK, then why do you use absolute positioning? A simple flow of blocks should do exactly what you need.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Mittwoch, 29. September 2010 08:45
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

I don't think you got the problem.

The example renders as follows:

-----------------
5      |
6      |   4
7      |
-----------------

           8

-----------------

Block 4 has no height, so 5 6 7 are rendered at same place.

What we expect is, that block 4 gets exactly the height of its contents, so the result would be


-----------------

           4
-----------------
5
6
7
-----------------

           8

-----------------


Are there any other methods to create overlaying regions?

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:57
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

What about a table with two cells, one cell with 5-7, second cell with 4? Block 8 starts after the table.

Mit freundlichen Grüßen

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 09:47
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

thanks for the quick reply, but that doesn't solve my problem. I know that block 4 is behind 5-7, because the surrounding block-container has no height. What I want to achieve is, that the top level block container has automatically the height of the contents. In the example below 1.5cm. In this example, the height is known, but there may be cases where a block contains long texts which may span multiple lines, where we don't know in advance how much space is used.

<fo:block-container width="100%" background-color="#eeeeee">
  <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
    <fo:block>4</fo:block>
   </fo:block-container>
</fo:block-container>

In php/css we would append a <br clear="all" />, which forces the flow to continue below all previous elements, but a <fo:block clear="both" /> doesn't have any impact on the height in fop.

Btw: We use fop 1.0

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY


-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:25
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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



---------------------------------------------------------------------
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



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


AW: Height of a block-container with absolutely positioned children

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

OK, then why do you use absolute positioning? A simple flow of blocks should do exactly what you need.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Mittwoch, 29. September 2010 08:45
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

I don't think you got the problem.

The example renders as follows:

-----------------
5      |
6      |   4
7      |
-----------------

           8

-----------------

Block 4 has no height, so 5 6 7 are rendered at same place.

What we expect is, that block 4 gets exactly the height of its contents, so the result would be


-----------------

           4
-----------------
5
6
7
-----------------

           8

-----------------


Are there any other methods to create overlaying regions?

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:57
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

What about a table with two cells, one cell with 5-7, second cell with 4? Block 8 starts after the table.

Mit freundlichen Grüßen

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 09:47
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

thanks for the quick reply, but that doesn't solve my problem. I know that block 4 is behind 5-7, because the surrounding block-container has no height. What I want to achieve is, that the top level block container has automatically the height of the contents. In the example below 1.5cm. In this example, the height is known, but there may be cases where a block contains long texts which may span multiple lines, where we don't know in advance how much space is used.

<fo:block-container width="100%" background-color="#eeeeee">
  <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
    <fo:block>4</fo:block>
   </fo:block-container>
</fo:block-container>

In php/css we would append a <br clear="all" />, which forces the flow to continue below all previous elements, but a <fo:block clear="both" /> doesn't have any impact on the height in fop.

Btw: We use fop 1.0

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY


-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:25
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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



---------------------------------------------------------------------
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


AW: Height of a block-container with absolutely positioned children

Posted by An...@picturemaxx.com.
Hi,

I don't think you got the problem.

The example renders as follows:

-----------------
5      |
6      |   4
7      |
-----------------

           8

-----------------

Block 4 has no height, so 5 6 7 are rendered at same place.

What we expect is, that block 4 gets exactly the height of its contents, so the result would be


-----------------

           4
-----------------
5      
6      
7      
-----------------

           8

-----------------


Are there any other methods to create overlaying regions?

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de] 
Gesendet: Dienstag, 28. September 2010 09:57
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

What about a table with two cells, one cell with 5-7, second cell with 4? Block 8 starts after the table.

Mit freundlichen Grüßen

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 09:47
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

thanks for the quick reply, but that doesn't solve my problem. I know that block 4 is behind 5-7, because the surrounding block-container has no height. What I want to achieve is, that the top level block container has automatically the height of the contents. In the example below 1.5cm. In this example, the height is known, but there may be cases where a block contains long texts which may span multiple lines, where we don't know in advance how much space is used.

<fo:block-container width="100%" background-color="#eeeeee">
  <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
    <fo:block>4</fo:block>
   </fo:block-container>
</fo:block-container>

In php/css we would append a <br clear="all" />, which forces the flow to continue below all previous elements, but a <fo:block clear="both" /> doesn't have any impact on the height in fop.

Btw: We use fop 1.0

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY


-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:25
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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



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


AW: Height of a block-container with absolutely positioned children

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

What about a table with two cells, one cell with 5-7, second cell with 4? Block 8 starts after the table.

Mit freundlichen Grüßen

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 09:47
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi,

thanks for the quick reply, but that doesn't solve my problem. I know that block 4 is behind 5-7, because the surrounding block-container has no height. What I want to achieve is, that the top level block container has automatically the height of the contents. In the example below 1.5cm. In this example, the height is known, but there may be cases where a block contains long texts which may span multiple lines, where we don't know in advance how much space is used.

<fo:block-container width="100%" background-color="#eeeeee">
  <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
    <fo:block>4</fo:block>
   </fo:block-container>
</fo:block-container>

In php/css we would append a <br clear="all" />, which forces the flow to continue below all previous elements, but a <fo:block clear="both" /> doesn't have any impact on the height in fop.

Btw: We use fop 1.0

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY


-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de]
Gesendet: Dienstag, 28. September 2010 09:25
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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


AW: Height of a block-container with absolutely positioned children

Posted by An...@picturemaxx.com.
Hi,

thanks for the quick reply, but that doesn't solve my problem. I know that block 4 is behind 5-7, because the surrounding block-container has no height. What I want to achieve is, that the top level block container has automatically the height of the contents. In the example below 1.5cm. In this example, the height is known, but there may be cases where a block contains long texts which may span multiple lines, where we don't know in advance how much space is used.

<fo:block-container width="100%" background-color="#eeeeee">
  <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
    <fo:block>4</fo:block>
   </fo:block-container>
</fo:block-container>

In php/css we would append a <br clear="all" />, which forces the flow to continue below all previous elements, but a <fo:block clear="both" /> doesn't have any impact on the height in fop.

Btw: We use fop 1.0

Best,
Andreas

------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY


-----Ursprüngliche Nachricht-----
Von: Georg Datterl [mailto:georg.datterl@geneon.de] 
Gesendet: Dienstag, 28. September 2010 09:25
An: fop-users@xmlgraphics.apache.org
Betreff: AW: Height of a block-container with absolutely positioned children

Hi Andreas,

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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



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


AW: Height of a block-container with absolutely positioned children

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

Block 4 is not visible, because it's behind Block 6 and 7. Set the width of the block-container surrounding blocks 5 - 7 to 50% and you will see Block 4.

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: Andreas.Zehender@picturemaxx.com [mailto:Andreas.Zehender@picturemaxx.com]
Gesendet: Dienstag, 28. September 2010 08:59
An: fop-users@xmlgraphics.apache.org
Betreff: Height of a block-container with absolutely positioned children

Hi,

we have a user defined report generator, where users can position sql fields inside blocks with sql data.

-------------------------------    Report Block
[Field A]       [Field B]
    Text Label
            [       ]
            [Field C]
            [       ]
-------------------------------

I tried to use hierarchical block containers so far, top level as container, and on second level absolutely positioned block containers as child elements. Everything works correctly, when I specify a height for the top level container. However, in some cases the top level container should expand, when contents inside the container doesn't fit. I tried to simply remove the height attribute, but since the block containers on second level are taken out of the flow, the parent container doesn't use space and has zero height.

See sample below. block "4" is not visible in pdf.

Is there a way to automatically enlarge the parent container, or to enforce the flow below the content of the container, although the child containers are absolutely positioned?

Best,
Andreas

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="simple"
                  page-height="29.7cm"
                  page-width="21cm"
                  margin-top="1cm"
                  margin-bottom="1cm"
                  margin-left="2.5cm"
                  margin-right="2.5cm">
      <fo:region-body margin-top="3cm" margin-bottom="3cm"/>
      <fo:region-before extent="0cm"/>
      <fo:region-after extent="-3cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simple">
        <fo:static-content flow-name="xsl-region-before" background-color="#eeeeee">
                <fo:block font-size="10.00pt" background-color="#eeeeee">header 1</fo:block>
        </fo:static-content>
        <fo:static-content flow-name="xsl-region-after" background-color="#dddddd">
                <fo:block font-size="10.00pt" background-color="#dddddd">footer 1</fo:block>
        </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>4</fo:block>
                        </fo:block-container>
                </fo:block-container>
                <fo:block-container width="100%" background-color="#eeeeee">
                        <fo:block>5</fo:block>
                        <fo:block>6</fo:block>
                        <fo:block>7</fo:block>
                </fo:block-container>
                <fo:block-container height="2.00cm" width="100%" background-color="#dddddd">
                        <fo:block-container absolute-position="absolute" left="13.00cm" top="1.00cm" width="4.00cm" height="0.50cm" color="#000000"  font-size="8.00pt" text-align="left" vertical-align="top" >
                                <fo:block>8</fo:block>
                        </fo:block-container>
                </fo:block-container>
    </fo:flow>
  </fo:page-sequence>
</fo:root>



------------------------------------
Andreas Zehender
Master of Computer Science
Software Development
------------------------------------
picturemaxx AG
Stefan-George-Ring 2
81929 München
GERMANY

---------------------------------------------------------------------
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