Bug 15048 - Unwanted page break after image linked by external-graphic in region body
Summary: Unwanted page break after image linked by external-graphic in region body
Status: CLOSED DUPLICATE of bug 3044
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: pdf (show other bugs)
Version: 0.20.3
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-04 04:01 UTC by Sherlane Lam
Modified: 2012-04-01 13:54 UTC (History)
0 users



Attachments
fo file (17.05 KB, text/plain)
2002-12-04 05:28 UTC, Sherlane Lam
Details
image 1 (7.70 KB, image/gif)
2002-12-04 05:31 UTC, Sherlane Lam
Details
image 2 (49.46 KB, image/jpeg)
2002-12-04 05:31 UTC, Sherlane Lam
Details
image 3 (51.48 KB, image/jpeg)
2002-12-04 05:31 UTC, Sherlane Lam
Details
image 4 (69.18 KB, image/jpeg)
2002-12-04 05:31 UTC, Sherlane Lam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sherlane Lam 2002-12-04 04:01:11 UTC
I want to generate a pdf with a list of images.  I suppose them to be shown in 
the pdf one by one.  And, if the two images are size small enough, they can be 
placed in 1 page together.  However, I find that no matter how small the images 
are, there must be a page break for each image.  The sample code is like this:
:
<fo:block page-break-before="avoid" page-break-after="avoid">
  <xsl:for-each select="ADVICE/IMAGE">
    <fo:wrapper>
     <fo:external-graphic>
       <xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
     </fo:external-graphic>
    </fo:wrapper>
  </xsl:for-each>					
</fo:block>			
:

Then, I try to put another text block after the image block like this:
<fo:block page-break-before="avoid" page-break-after="avoid">
  <xsl:for-each select="ADVICE/IMAGE">
    <fo:wrapper>
      <fo:external-graphic>
	<xsl:attribute name="src"><xsl:value-of select="."/></xsl:attribute>
      </fo:external-graphic>
    </fo:wrapper>
    <fo:wrapper>Testing data line</fo:wrapper>
  </xsl:for-each>					
</fo:block>					
<fo:block>Another testing data line</fo:block>
				
The first text 'Testing data line' can be shown just next to the each image 
sucessfully in the same page.  However, the last text 'Another testing data 
line' cannot be shown in the same page with the last image, even the last image 
is so small.  A page break is forced to appear just after the image.

I have tried to use table cell for the display like this,
<fo:table>
  <fo:table-column column-width="20cm"/>
  <fo:table-body>
    <xsl:for-each select="ADVICE/IMAGE">				        
      <fo:table-row>
        <fo:table-cell display-align="center">
          <fo:block text-align="center">
            <fo:external-graphic display-align="center" text-align="center">
               <xsl:attribute name="src"><xsl:value-of 
select="."/></xsl:attribute>
            </fo:external-graphic>	
          </fo:block>
        </fo:table-cell>
      </fo:table-row>
    </xsl:for-each>
  </fo:table-body>
</fo:table>

But the result is still the same.

On the other hand, I just put the same coding in the static content as region-
before, it can be shown successfully without page break (I think it is still to 
region-before cannot be page break).

Is it the internal problem of FOP?  Anything we can do to help?

SL
Comment 1 J. Rhett Aultman 2002-12-04 04:49:35 UTC
Really, the biggest help would be to post a FO document (no XSL, just the 
FO...i.e. do your XML transformation and produce an FO document) and set of 
graphics that we can use as a test case.

Also, you may wish to check out a more recent version of FOP and see if the 
issue recurrs.  The test case is most important to us, however.
Comment 2 Sherlane Lam 2002-12-04 05:28:00 UTC
Created attachment 4035 [details]
fo file
Comment 3 Sherlane Lam 2002-12-04 05:31:03 UTC
Created attachment 4037 [details]
image 1
Comment 4 Sherlane Lam 2002-12-04 05:31:21 UTC
Created attachment 4038 [details]
image 2
Comment 5 Sherlane Lam 2002-12-04 05:31:37 UTC
Created attachment 4039 [details]
image 3
Comment 6 Sherlane Lam 2002-12-04 05:31:53 UTC
Created attachment 4040 [details]
image 4
Comment 7 Sherlane Lam 2002-12-04 05:34:41 UTC
I have attached the fo and images file for your reference.  The reason that we 
use 20.3 rather 20.4 is we find that 20.4 has out of memory problem when 
removing the embed-file attribute from the userconfig.xml.  We have to generate 
a pdf for muti-asian languages, therefore, we have to choose a lower version.
Comment 8 Oleg Tkachenko 2002-12-04 10:21:32 UTC
page-break-before="avoid" is a shorthand of keep-with-previous="always" (the
same for page-break-after="avoid"), but it's documented limitation of the
current version that keep properties are only supported on table rows. It's
addressed by the redesign process under way. 
Usual workaround is a blind table with keep-* properties on its rows.

*** This bug has been marked as a duplicate of 3044 ***
Comment 9 Glenn Adams 2012-04-01 13:54:21 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs