Bug 42601 - Image/text misalignment inside before-region tables
Summary: Image/text misalignment inside before-region tables
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: images (show other bugs)
Version: 0.93
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-06 01:55 UTC by Corneliu Margine
Modified: 2012-04-01 06:55 UTC (History)
1 user (show)



Attachments
Sample FO code (excerpt) (5.73 KB, text/plain)
2007-06-08 01:10 UTC, Corneliu Margine
Details
Sample result screenshot (blocks highlighted with different colors) (24.30 KB, image/png)
2007-06-08 01:13 UTC, Corneliu Margine
Details
Sample FO code (excerpt) (4.35 KB, text/plain)
2007-06-08 01:22 UTC, Corneliu Margine
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Corneliu Margine 2007-06-06 01:55:15 UTC
Placing an image and some text inside adjacent cells (same row) of a table makes
the image get "shifted" down, below the point where the text block finishes. Two
adjacent images, or two adjacent text blocks don't exhibit the same behavior.
Important note: this only happens inside the "before" region. The same code
moved into the "body" region works just fine.

To reproduce, add the following to the "before" region, placing a real image
location in the external graphic:

<fo:table>
	<fo:table-column/>
	<fo:table-column/>
	<fo:table-body>
		<fo:table-row>
			<fo:table-cell>
				<fo:block>
					<fo:external-graphic src="SOME_IMAGE_GOES_HERE"/>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell>
				<fo:block>
					This is ASF Bugzilla: the Apache Software Foundation bug system. In case of
problems with the functioning of ASF Bugzilla, please contact
bugzilla-admin@apache.org. Please Note: this e-mail address is only for
reporting problems with ASF Bugzilla. Mail about any other subject will be
silently ignored.
				</fo:block>
			</fo:table-cell>				
		</fo:table-row>
	</fo:table-body>
</fo:table>

The result will contain the image "shifted" below the end of the text block (as
if in a completely new row, following the one that contains the text).
Comment 1 Chris Bowditch 2007-06-07 00:35:35 UTC
Please can you attach a complete FO file for analysis. When submit your FO to 
FOP do you see a warning message to the effect that some content has been 
truncated?
Comment 2 Corneliu Margine 2007-06-08 01:10:46 UTC
Created attachment 20324 [details]
Sample FO code (excerpt)
Comment 3 Corneliu Margine 2007-06-08 01:13:19 UTC
Created attachment 20325 [details]
Sample result screenshot (blocks highlighted with different colors)
Comment 4 Corneliu Margine 2007-06-08 01:17:39 UTC
(In reply to comment #1)
> Please can you attach a complete FO file for analysis. When submit your FO to 
> FOP do you see a warning message to the effect that some content has been 
> truncated?

Here is an excerpt of the FO file, irrelevant parts stripped. Also you can find
a screenshot of the result. FOP does not seem to display any warning or error
messages.
Comment 5 Corneliu Margine 2007-06-08 01:21:06 UTC
Comment on attachment 20324 [details]
Sample FO code (excerpt)

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions" id="root">
   <fo:layout-master-set>
      <fo:simple-page-master page-height="29.7cm" page-width="21.0cm"
margin-top="1cm" margin-bottom="1cm" margin-right="1.5cm" margin-left="1.5cm"
master-name="cover">
	 <fo:region-body margin="1cm" margin-top="1.5cm" margin-bottom="1.5cm"
/>
	 <fo:region-before extent="1.5cm" margin="1mm" />
	 <fo:region-after extent="1.5cm" margin="1mm" />
	 <fo:region-start margin="1mm" extent="1cm" />
	 <fo:region-end margin="1mm" extent="1cm" />
      </fo:simple-page-master>
      <fo:simple-page-master page-height="29.7cm" page-width="21.0cm"
margin-top="1cm" margin-bottom="1cm" margin-right="1.5cm" margin-left="1.5cm"
master-name="body">
	 <fo:region-body margin="1cm" margin-top="1.5cm" margin-bottom="1.5cm"
/>
	 <fo:region-before extent="1.5cm" margin="1mm" />
	 <fo:region-after extent="1.5cm" margin="1mm" />
	 <fo:region-start margin="1mm" extent="1cm" />
	 <fo:region-end margin="1mm" extent="1cm" />
      </fo:simple-page-master>
      <fo:simple-page-master page-height="29.7cm" page-width="21.0cm"
margin-top="1cm" margin-bottom="1cm" margin-right="1.5cm" margin-left="1.5cm"
master-name="first">
	 <fo:region-body margin="1cm" margin-top="1.5cm" margin-bottom="1.5cm"
/>
	 <fo:region-before extent="1.5cm" margin="1mm" />
	 <fo:region-after extent="1.5cm" margin="1mm" />
	 <fo:region-start margin="1mm" extent="1cm" />
	 <fo:region-end margin="1mm" extent="1cm" />
      </fo:simple-page-master>
      <fo:simple-page-master page-height="29.7cm" page-width="21.0cm"
margin-top="1cm" margin-bottom="1cm" margin-right="1.5cm" margin-left="1.5cm"
master-name="last">
	 <fo:region-body margin="1cm" margin-top="1.5cm" margin-bottom="1.5cm"
/>
	 <fo:region-before extent="1.5cm" margin="1mm" />
	 <fo:region-after extent="1.5cm" margin="1mm" />
	 <fo:region-start margin="1mm" extent="1cm" />
	 <fo:region-end margin="1mm" extent="1cm" />
      </fo:simple-page-master>
   </fo:layout-master-set>
   <fo:page-sequence master-reference="cover">
      <fo:static-content flow-name="xsl-region-before">
	 <fo:table margin-left="1%" margin-right="1%" font-weight="normal"
font-family="verdana, Arial, Helvetica, sans-serif" background-color="#FF0000"
color="black" table-layout="fixed" width="98%" space-before="5mm"
space-after="5mm">
	    <fo:table-column />
	    <fo:table-column />
	    <fo:table-body>
	       <fo:table-row>
		  <fo:table-cell>
		     <fo:block text-align="start" font-size="10pt"
font-family="verdana, Arial, Helvetica, sans-serif" background-color="#00FF00">
			<fo:external-graphic content-width="scale-to-fit"
width="100%" height="100%"
src="file:/com/finantix/ice/document/lim/xsl/ux/util/img/companyLogo.pdf.png"
/>
		     </fo:block>
		  </fo:table-cell>
		  <fo:table-cell>
		     <fo:block text-align="end" font-size="10pt"
font-family="verdana, Arial, Helvetica, sans-serif"
background-color="#0000FF">Consulenza</fo:block>
		  </fo:table-cell>
	       </fo:table-row>
	    </fo:table-body>
	 </fo:table>
      </fo:static-content>
      <fo:flow flow-name="xsl-region-body">
	 <fo:block space-after="18cm" />
	 <fo:block font-size="10pt" font-family="verdana, arial, Helvetica,
sans-serif" font-weight="normal" font-style="normal" space-after="1cm">HTML,
DHTML, XML, XHTML are trademarks or registered&#xD;
trademarks of W3CA®, World Wide Web Consortium,&#xD;
Massachusetts Institute of Technology.</fo:block>
	 <fo:block font-size="10pt" font-family="verdana, arial, Helvetica,
sans-serif" font-weight="normal" font-style="normal" space-after="1cm">JAVAA®
is a registered trademark of Sun Microsystems, Inc.</fo:block>
	 <fo:block font-size="10pt" font-family="verdana, arial, Helvetica,
sans-serif" font-weight="normal" font-style="normal"
space-after="1cm">JAVASCRIPTA® is a registered trademark of Sun
Microsystems,&#xD;
Inc., used under license for technology invented and&#xD;
implemented by Netscape.</fo:block>
      </fo:flow>
   </fo:page-sequence>
</fo:root>
Comment 6 Corneliu Margine 2007-06-08 01:22:12 UTC
Created attachment 20326 [details]
Sample FO code (excerpt)
Comment 7 Murad Mamedov 2009-02-05 05:55:06 UTC
Is there any way to workaround this problem?
Comment 8 Jeremias Maerki 2009-02-05 06:06:53 UTC
(In reply to comment #7)
> Is there any way to workaround this problem?
> 

Not necessary. The bug is fixed in 0.95. And to get rid of the green parts above and below the logo, you can set font-size="0pt" and line-height="1" on the parent block.

The downshift was caused by an overflow in the static-content. This is now done differently so this doesn't occur anymore.
Comment 9 Glenn Adams 2012-04-01 06:55:08 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed