Re: RE : Endless Loop in PDF

2005-08-31 Thread Jeremias Maerki
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:

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




Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RE : Endless Loop in PDF

2005-08-31 Thread Jeremias Maerki
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:[EMAIL PROTECTED] 
> > 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 :
> > > 
> > > 
> > >> >   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"/>
> > > 
> > > 
> > > 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> Jeremias Maerki
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE : RE : Endless Loop in PDF

2005-08-31 Thread michella
I have four specific cases that should be automatically handled :

Let X be maxWidth, let Y be maxHeight (in px):

1. if imgWidth > X and imgHeight <= Y --> uniform scale until imgWidth fits to X
2. if imgWidth > X and imgHeight > Y --> uniform scale until imgWidth and 
imgHeigth fits to X and Y
3. if imgWidth <= X and imgHeight > Y --> uniform scale until imgHeigth fits to 
Y
4. if imgWidth <= X and imgHeight <= Y --> Leave as is.

Is there a way to do that?

By the way, I converted the GIF into PNG. The problem remain same.
I resized it to W/H = 500/476, it worked properly (both as GIF and PNG)


-Message d'origine-
De : Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi, 31. août 2005 15:04
À : fop-users@xmlgraphics.apache.org
Objet : Re: RE : Endless Loop in PDF



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.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: RE : Endless Loop in PDF

2005-08-31 Thread Jeremias Maerki

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:[EMAIL PROTECTED] 
> 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 :
> > 
> > 
> >  > 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"/>
> > 
> > 
> > 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE : Endless Loop in PDF

2005-08-31 Thread michella
The SVG Sizes are set in a way that they won't exceed WIDTH=505px and 
HEIGHT=710px

Example : one SVG is WIDTH=505px and HEIGHT=515px

The GIF Size is WIDTH=1169px and HEIGHT=1293px. There is some scaling 
requirements while inserting into the PDF

Lawrence


-Message d'origine-
De : Manuel Mall [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi, 31. août 2005 12:54
À : fop-users@xmlgraphics.apache.org
Objet : Re: Endless Loop in PDF


Are the SVG and JPEG images the same size as the GIF, i.e. same number 
of pixels horz/vert and same resolution (dots/in)? What size is the 
actual GIF in pixels horz/vert?

BTW, the content-type should most likely be "image/gif" but I doubt it 
matters.

Manuel

On Wed, 31 Aug 2005 06:43 pm, [EMAIL PROTECTED] wrote:
> Sorry, I forgot to post the fo:external-graphics :
>
> 
>  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"/>
> 
>
> 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
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE : Endless Loop in PDF

2005-08-31 Thread michella
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:[EMAIL PROTECTED] 
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 :
> 
> 
>  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"/>
> 
> 
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Endless Loop in PDF

2005-08-31 Thread Jeremias Maerki
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 :
> 
> 
>  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"/>
> 
> 
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Endless Loop in PDF

2005-08-31 Thread Jeremias Maerki
FYI, the content-type property is ignored!

On 31.08.2005 12:53:49 Manuel Mall wrote:
> BTW, the content-type should most likely be "image/gif" but I doubt it 
> matters.

Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Endless Loop in PDF

2005-08-31 Thread Chris Bowditch

[EMAIL PROTECTED] wrote:


Sorry, I forgot to post the fo:external-graphics :


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




Well it's bad pratice to use device dependent measurements for 
measurements in XSL-FO. And if you use them for images, then 72dpi is 
assumed, which will make the image 7in x 9.86in which is probably why is 
doesn't fit on the page or subsequent pages. Specify the size you would 
like the image to appear in inches or millimetres instead.


Chris


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Endless Loop in PDF

2005-08-31 Thread Manuel Mall
Are the SVG and JPEG images the same size as the GIF, i.e. same number 
of pixels horz/vert and same resolution (dots/in)? What size is the 
actual GIF in pixels horz/vert?

BTW, the content-type should most likely be "image/gif" but I doubt it 
matters.

Manuel

On Wed, 31 Aug 2005 06:43 pm, [EMAIL PROTECTED] wrote:
> Sorry, I forgot to post the fo:external-graphics :
>
> 
>  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"/>
> 
>
> 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
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Endless Loop in PDF

2005-08-31 Thread michella
Sorry, I forgot to post the fo:external-graphics :





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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]