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 mi...@post.ch on 2005/08/31 14:37:35 UTC

RE : Endless Loop in PDF

Ok... But how could it be possible that it had worked properly with the older version of FOP?

The problem I have is that I may have some GIF images that may be larger/higher than the area on the PDF, and some which are smaller. For the bigger one, it should scale-to-fit, and the smaller ones leave as is.

Lawrence
-----Message d'origine-----
De : Jeremias Maerki [mailto:dev.jeremias@greenmail.ch] 
Envoyé : mercredi, 31. août 2005 14:31
À : fop-users@xmlgraphics.apache.org
Objet : Re: Endless Loop in PDF


And to add to the other comments, you should rather use content-height
and content-width instead of i-p-d and b-p-d because the latter only
defines the size of the viewport, not of the reference area in which the
image is painted. There seems to be a lot of confusion about the use of
these properties especially since FOP Trunk provides a better
conformance to the spec than FOP 0.20.5. I'll write a demo file
demonstrating all the effects of the different properties. On the other
side, there may still be bugs in the layout manager for external-graphics.

On 31.08.2005 12:43:18 michella wrote:
> Sorry, I forgot to post the fo:external-graphics :
> 
> <fo:block text-align="center" padding-after="15pt">
> 	<fo:external-graphic 
> 		content-type="image/bmp" 
> 		src="../Publikation/Images/HS_Einfaechern.gif" 
> 		inline-progression-dimension.optimum="auto" 
> 		inline-progression-dimension.maximum="505px" 
> 		block-progression-dimension.optimum="auto" 
> 		block-progression-dimension.maximum="710px" 
> 		scaling="uniform"/>
> </fo:block>
> 
> I always get : Exception
> java.lang.RuntimeException: Some content could not fit into a line/page
> after 50
>  attempts. Giving up to avoid an endless loop.
> 
> When I set "inline-progression-dimension.maximum" and
> "block-progression-dimension.maximum" lower, it won't change anything.
> 
> Notice : I use exactly the same externa-graphics attribute value for JPG
> and SVGs. No Problem.
> 
> Lawrence


Jeremias Maerki


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


Re: RE : Endless Loop in PDF

Posted by Jeremias Maerki <de...@greenmail.ch>.
Ok, the min/opt/max stuff definitely doesn't work correctly, yet. I'd
simply set a hard-coded height value (preferably not in "px") and use
content-height="scale-to-fit". That should solve your problem and
maintain compatibility to 0.20.5.

On 31.08.2005 15:31:23 Jeremias Maerki wrote:
<snip/>
> I'm not sure if the min/opt/max adjustment is done correctly, yet, i.e.
> that FOP automatically shrinks the image if it doesn't fit into the
> page.I have to investigate that first.
<snip/>



Jeremias Maerki


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


Re: RE : Endless Loop in PDF

Posted by Jeremias Maerki <de...@greenmail.ch>.
I've just committed the demo section to examples/fo/images.fo.

http://svn.apache.org/viewcvs?rev=265037&view=rev

I must say I'm happy to see that FOP seems to do its job well now (FOP
Trunk). You should quickly find the property combination you need to use
in your case. 

My suggestion below is probably the right thing in your case:
Use b-p-d and content-height="scale-to-fit" but I'm not sure if the min/opt/max
adjustment is done correctly, yet, i.e. that FOP automatically shrinks
the image if it doesn't fit into the page. I have to investigate that
first. And I've only checked bitmap images so far. I need to have a look
at SVG graphics to see if it works fine, too.

On 31.08.2005 15:04:07 Jeremias Maerki wrote:
> 
> On 31.08.2005 14:37:35 michella wrote:
> > Ok... But how could it be possible that it had worked properly with the
> > older version of FOP?
> 
> Rather, it could be that FOP Trunk finally does what the specification
> says. :-) content-height was not supported by FOP 0.20.5 and the
> width/height properties were used to scale the image which is clearly
> wrong.
> 
> > The problem I have is that I may have some GIF images that may be
> > larger/higher than the area on the PDF, and some which are smaller. For
> > the bigger one, it should scale-to-fit, and the smaller ones leave as
> > is.
> 
> In that case I think you'd use just b-p-d as before but left i-p-d off
> so it is automatically determined and used content-width="scale-to-fit"
> and content-height="scale-to-fit. Not sure if this will work. I'm
> currently writing the demo file for external-graphic. After that I can
> verify if FOP really does what it should in every case.
> 
> > Lawrence
> > -----Message d'origine-----
> > De : Jeremias Maerki [mailto:dev.jeremias@greenmail.ch] 
> > Envoyé : mercredi, 31. août 2005 14:31
> > À : fop-users@xmlgraphics.apache.org
> > Objet : Re: Endless Loop in PDF
> > 
> > 
> > And to add to the other comments, you should rather use content-height
> > and content-width instead of i-p-d and b-p-d because the latter only
> > defines the size of the viewport, not of the reference area in which the
> > image is painted. There seems to be a lot of confusion about the use of
> > these properties especially since FOP Trunk provides a better
> > conformance to the spec than FOP 0.20.5. I'll write a demo file
> > demonstrating all the effects of the different properties. On the other
> > side, there may still be bugs in the layout manager for external-graphics.
> > 
> > On 31.08.2005 12:43:18 michella wrote:
> > > Sorry, I forgot to post the fo:external-graphics :
> > > 
> > > <fo:block text-align="center" padding-after="15pt">
> > > 	<fo:external-graphic 
> > > 		content-type="image/bmp" 
> > > 		src="../Publikation/Images/HS_Einfaechern.gif" 
> > > 		inline-progression-dimension.optimum="auto" 
> > > 		inline-progression-dimension.maximum="505px" 
> > > 		block-progression-dimension.optimum="auto" 
> > > 		block-progression-dimension.maximum="710px" 
> > > 		scaling="uniform"/>
> > > </fo:block>
> > > 
> > > I always get : Exception
> > > java.lang.RuntimeException: Some content could not fit into a line/page
> > > after 50
> > >  attempts. Giving up to avoid an endless loop.
> > > 
> > > When I set "inline-progression-dimension.maximum" and
> > > "block-progression-dimension.maximum" lower, it won't change anything.
> > > 
> > > Notice : I use exactly the same externa-graphics attribute value for JPG
> > > and SVGs. No Problem.
> > > 
> > > Lawrence
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



Jeremias Maerki


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


Re: RE : Endless Loop in PDF

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 31.08.2005 14:37:35 michella wrote:
> Ok... But how could it be possible that it had worked properly with the
> older version of FOP?

Rather, it could be that FOP Trunk finally does what the specification
says. :-) content-height was not supported by FOP 0.20.5 and the
width/height properties were used to scale the image which is clearly
wrong.

> The problem I have is that I may have some GIF images that may be
> larger/higher than the area on the PDF, and some which are smaller. For
> the bigger one, it should scale-to-fit, and the smaller ones leave as
> is.

In that case I think you'd use just b-p-d as before but left i-p-d off
so it is automatically determined and used content-width="scale-to-fit"
and content-height="scale-to-fit. Not sure if this will work. I'm
currently writing the demo file for external-graphic. After that I can
verify if FOP really does what it should in every case.

> Lawrence
> -----Message d'origine-----
> De : Jeremias Maerki [mailto:dev.jeremias@greenmail.ch] 
> Envoyé : mercredi, 31. août 2005 14:31
> À : fop-users@xmlgraphics.apache.org
> Objet : Re: Endless Loop in PDF
> 
> 
> And to add to the other comments, you should rather use content-height
> and content-width instead of i-p-d and b-p-d because the latter only
> defines the size of the viewport, not of the reference area in which the
> image is painted. There seems to be a lot of confusion about the use of
> these properties especially since FOP Trunk provides a better
> conformance to the spec than FOP 0.20.5. I'll write a demo file
> demonstrating all the effects of the different properties. On the other
> side, there may still be bugs in the layout manager for external-graphics.
> 
> On 31.08.2005 12:43:18 michella wrote:
> > Sorry, I forgot to post the fo:external-graphics :
> > 
> > <fo:block text-align="center" padding-after="15pt">
> > 	<fo:external-graphic 
> > 		content-type="image/bmp" 
> > 		src="../Publikation/Images/HS_Einfaechern.gif" 
> > 		inline-progression-dimension.optimum="auto" 
> > 		inline-progression-dimension.maximum="505px" 
> > 		block-progression-dimension.optimum="auto" 
> > 		block-progression-dimension.maximum="710px" 
> > 		scaling="uniform"/>
> > </fo:block>
> > 
> > I always get : Exception
> > java.lang.RuntimeException: Some content could not fit into a line/page
> > after 50
> >  attempts. Giving up to avoid an endless loop.
> > 
> > When I set "inline-progression-dimension.maximum" and
> > "block-progression-dimension.maximum" lower, it won't change anything.
> > 
> > Notice : I use exactly the same externa-graphics attribute value for JPG
> > and SVGs. No Problem.
> > 
> > Lawrence
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> 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



Jeremias Maerki


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