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 _zachary_ <zd...@mac.com> on 2008/06/03 18:04:32 UTC

0.94 AND 0.95b Images

Hey Guys,

I would love some help on this issue because it has been driving me crazy.
First, let me describe what I am trying to do.  I am trying to make images
that are bigger than my fo:block shrink to the size of the block, breaking
it off to its own line, so that no text is before or after it.  Next, for
the images that are smaller than my block I want my text to flow around the
image.

Now then, the only way that I have been able to obtain this functionality is
by calculating the widths of the images, if they are bigger than my fo:block
then i do the following:
  <fo:external-graphic src="url('{@src}')">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
    <xsl:attribute name="content-height">100%</xsl:attribute>
  </fo:external-graphic>
This code works great for the big images, however when I apply the same code
to the smaller images they don't allow text to flow around them, due to the
width being 100%.  I tried using the scale-down-to-fit method in 0.95b but
it didn't seem to do anything.  Does anyone have a solution to this so that
my code can be dynamic and I don't have to do many calculations to fix the
width?

Thank you for your time

zach
-- 
View this message in context: http://www.nabble.com/0.94-AND-0.95b-Images-tp17627201p17627201.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: 0.94 AND 0.95b Images

Posted by Andreas Delmelle <an...@telenet.be>.
On Jun 3, 2008, at 18:04, _zachary_ wrote:

Hi

> I would love some help on this issue because it has been driving me  
> crazy.
> First, let me describe what I am trying to do.  I am trying to make  
> images
> that are bigger than my fo:block shrink to the size of the block,  
> breaking
> it off to its own line, so that no text is before or after it.   
> Next, for
> the images that are smaller than my block I want my text to flow  
> around the
> image.

To better understand whether what you need is even possible: What do  
you mean by 'flow' exactly?
A simple inline external-graphic or instream-foreign-object will  
become a part of the containing line-area.

For the smaller images, you would get something like:

[IMAGE] following text on the same line
[IMAGE]
[IMAGE]
following text on the next line

The only thing you can control is the placement of the graphic. By  
adjusting the area alignment, you can influence where it is placed on  
the line relative to the baseline of the text.

If you really need a flowing effect like:

[IMAGE] following text on the same line
[IMAGE] following text on the next line
[IMAGE]

Then I'm afraid you're out of luck, since that would require a  
fo:float or fo:inline-container, both of which are currently  
unimplemented in FOP.

With a fo:float, something like the following would also be possible:

[IMAGE] following text on the same line
[IMAGE] following text on the next line
[IMAGE] following text on the next line
following text on the next line

With an fo:inline-container, the closest you get is:

[IMAGE] following text on the same line
[IMAGE] following text on the next line
[IMAGE] following text on the next line
         following text on the next line

This last bit can also be mimicked by using an fo:table with two  
columns.


Cheers

Andreas

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


Re: 0.94 AND 0.95b Images

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Remove the content-height attribute and it should work. That attribute
is in conflict with the maximum value and it seems that the conflict
resolution is not good enough, yet.

On 03.06.2008 20:11:12 _zachary_ wrote:
> 
> Actually I take my last comment back.  It seems as though I had left my code
> in there that was calculating the widths.  Thus this code:
> 
> <fo:external-graphic inline-progression-dimension.maximum="100%"
>                       content-width="scale-down-to-fit"
>                       content-height="100%" />
> 
> does not work.  I created a fo with two-columns, put a fo:block in the body
> and the image overflows the block still. Any ideas why that wouldn't be
> working? And I'm not getting any errors from fop
> 
> 
> Andreas Delmelle-2 wrote:
> > 
> > On Jun 3, 2008, at 18:51, _zachary_ wrote:
> > 
> >> As long as I do not do anything to my smaller images they work  
> >> fine, however,
> >> I want to use the same code for big and small images without having  
> >> to check
> >> for the widths. e.g.
> >>
> >> This is what happens when i don't add any attributes to my
> >> external-graphics, all I add is a src.
> >>
> >>                                                             |
> >> Hello there! [SMALL_IMAGE] oo this is coo   |
> >> o i know [SMALL_IMAGE] hello world blah    |
> >> [                     BIG_IMAGE                        
> >> |                ] (<-
> >> overflows the block-container)
> >> hello this is some more text blah balh blah   |
> >>
> >> So now how do I keep everything the same and just make the  
> >> BIG_IMAGE not
> >> overflow the block, but rather scale it down to fit within the  
> >> block.  I do
> >> not know the with of any of the images, and the small images need  
> >> to keep
> >> the same effect.
> > 
> > IIC, then the fact that you specify width="100%" is what's bugging  
> > you here.
> > 
> > Haven't tried, but I assume you would at least need to go with inline- 
> > progression-dimension, so you can control only the maximum value  
> > explicitly.
> > Something like:
> > 
> > <fo:external-graphic inline-progression-dimension.maximum="100%"
> >                       content-width="scale-down-to-fit"
> >                       content-height="100%" />
> > 
> > 
> > HTH!
> > 
> > Andreas
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/0.94-AND-0.95b-Images-tp17627201p17629647.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> 


Jeremias Maerki


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


Re: 0.94 AND 0.95b Images

Posted by _zachary_ <zd...@mac.com>.
Actually I take my last comment back.  It seems as though I had left my code
in there that was calculating the widths.  Thus this code:

<fo:external-graphic inline-progression-dimension.maximum="100%"
                      content-width="scale-down-to-fit"
                      content-height="100%" />

does not work.  I created a fo with two-columns, put a fo:block in the body
and the image overflows the block still. Any ideas why that wouldn't be
working? And I'm not getting any errors from fop


Andreas Delmelle-2 wrote:
> 
> On Jun 3, 2008, at 18:51, _zachary_ wrote:
> 
>> As long as I do not do anything to my smaller images they work  
>> fine, however,
>> I want to use the same code for big and small images without having  
>> to check
>> for the widths. e.g.
>>
>> This is what happens when i don't add any attributes to my
>> external-graphics, all I add is a src.
>>
>>                                                             |
>> Hello there! [SMALL_IMAGE] oo this is coo   |
>> o i know [SMALL_IMAGE] hello world blah    |
>> [                     BIG_IMAGE                        
>> |                ] (<-
>> overflows the block-container)
>> hello this is some more text blah balh blah   |
>>
>> So now how do I keep everything the same and just make the  
>> BIG_IMAGE not
>> overflow the block, but rather scale it down to fit within the  
>> block.  I do
>> not know the with of any of the images, and the small images need  
>> to keep
>> the same effect.
> 
> IIC, then the fact that you specify width="100%" is what's bugging  
> you here.
> 
> Haven't tried, but I assume you would at least need to go with inline- 
> progression-dimension, so you can control only the maximum value  
> explicitly.
> Something like:
> 
> <fo:external-graphic inline-progression-dimension.maximum="100%"
>                       content-width="scale-down-to-fit"
>                       content-height="100%" />
> 
> 
> HTH!
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/0.94-AND-0.95b-Images-tp17627201p17629647.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: 0.94 AND 0.95b Images

Posted by Andreas Delmelle <an...@telenet.be>.
On Jun 3, 2008, at 18:51, _zachary_ wrote:

> As long as I do not do anything to my smaller images they work  
> fine, however,
> I want to use the same code for big and small images without having  
> to check
> for the widths. e.g.
>
> This is what happens when i don't add any attributes to my
> external-graphics, all I add is a src.
>
>                                                             |
> Hello there! [SMALL_IMAGE] oo this is coo   |
> o i know [SMALL_IMAGE] hello world blah    |
> [                     BIG_IMAGE                        
> |                ] (<-
> overflows the block-container)
> hello this is some more text blah balh blah   |
>
> So now how do I keep everything the same and just make the  
> BIG_IMAGE not
> overflow the block, but rather scale it down to fit within the  
> block.  I do
> not know the with of any of the images, and the small images need  
> to keep
> the same effect.

IIC, then the fact that you specify width="100%" is what's bugging  
you here.

Haven't tried, but I assume you would at least need to go with inline- 
progression-dimension, so you can control only the maximum value  
explicitly.
Something like:

<fo:external-graphic inline-progression-dimension.maximum="100%"
                      content-width="scale-down-to-fit"
                      content-height="100%" />


HTH!

Andreas


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


Re: 0.94 AND 0.95b Images

Posted by _zachary_ <zd...@mac.com>.
Andreas!!! I LOVE YOU!

That worked beautifully!  Thank you so much for your help.

zach


_zachary_ wrote:
> 
> As long as I do not do anything to my smaller images they work fine,
> however, I want to use the same code for big and small images without
> having to check for the widths. e.g.
> 
> This is what happens when i don't add any attributes to my
> external-graphics, all I add is a src.
> 
>                                                             |
> Hello there! [SMALL_IMAGE] oo this is coo   |
> o i know [SMALL_IMAGE] hello world blah    |
> [                     BIG_IMAGE                       |                ]
> (<- overflows the block-container)
> hello this is some more text blah balh blah   |
> 
> So now how do I keep everything the same and just make the BIG_IMAGE not
> overflow the block, but rather scale it down to fit within the block.  I
> do not know the with of any of the images, and the small images need to
> keep the same effect.
> 
> 
> _zachary_ wrote:
>> 
>> Hey Guys,
>> 
>> I would love some help on this issue because it has been driving me
>> crazy. First, let me describe what I am trying to do.  I am trying to
>> make images that are bigger than my fo:block shrink to the size of the
>> block, breaking it off to its own line, so that no text is before or
>> after it.  Next, for the images that are smaller than my block I want my
>> text to flow around the image.
>> 
>> Now then, the only way that I have been able to obtain this functionality
>> is by calculating the widths of the images, if they are bigger than my
>> fo:block then i do the following:
>>   <fo:external-graphic src="url('{@src}')">
>>     <xsl:attribute name="width">100%</xsl:attribute>
>>     <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
>>     <xsl:attribute name="content-height">100%</xsl:attribute>
>>   </fo:external-graphic>
>> This code works great for the big images, however when I apply the same
>> code to the smaller images they don't allow text to flow around them, due
>> to the width being 100%.  I tried using the scale-down-to-fit method in
>> 0.95b but it didn't seem to do anything.  Does anyone have a solution to
>> this so that my code can be dynamic and I don't have to do many
>> calculations to fix the width?
>> 
>> Thank you for your time
>> 
>> zach
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/0.94-AND-0.95b-Images-tp17627201p17628882.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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


Re: 0.94 AND 0.95b Images

Posted by _zachary_ <zd...@mac.com>.
As long as I do not do anything to my smaller images they work fine, however,
I want to use the same code for big and small images without having to check
for the widths. e.g.

This is what happens when i don't add any attributes to my
external-graphics, all I add is a src.

                                                            |
Hello there! [SMALL_IMAGE] oo this is coo   |
o i know [SMALL_IMAGE] hello world blah    |
[                     BIG_IMAGE                       |                ] (<-
overflows the block-container)
hello this is some more text blah balh blah   |

So now how do I keep everything the same and just make the BIG_IMAGE not
overflow the block, but rather scale it down to fit within the block.  I do
not know the with of any of the images, and the small images need to keep
the same effect.


_zachary_ wrote:
> 
> Hey Guys,
> 
> I would love some help on this issue because it has been driving me crazy.
> First, let me describe what I am trying to do.  I am trying to make images
> that are bigger than my fo:block shrink to the size of the block, breaking
> it off to its own line, so that no text is before or after it.  Next, for
> the images that are smaller than my block I want my text to flow around
> the image.
> 
> Now then, the only way that I have been able to obtain this functionality
> is by calculating the widths of the images, if they are bigger than my
> fo:block then i do the following:
>   <fo:external-graphic src="url('{@src}')">
>     <xsl:attribute name="width">100%</xsl:attribute>
>     <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
>     <xsl:attribute name="content-height">100%</xsl:attribute>
>   </fo:external-graphic>
> This code works great for the big images, however when I apply the same
> code to the smaller images they don't allow text to flow around them, due
> to the width being 100%.  I tried using the scale-down-to-fit method in
> 0.95b but it didn't seem to do anything.  Does anyone have a solution to
> this so that my code can be dynamic and I don't have to do many
> calculations to fix the width?
> 
> Thank you for your time
> 
> zach
> 

-- 
View this message in context: http://www.nabble.com/0.94-AND-0.95b-Images-tp17627201p17628246.html
Sent from the FOP - Users mailing list archive at Nabble.com.


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