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 lexa2009 <my...@gmail.com> on 2009/12/28 10:48:37 UTC

problem with fo:inline and fo:external-graphic, overflows

hello. i want to generate pdf with text and some images inside it. 
for example this part of fo
<fo:block>
  sometext
  <fo:inline> 
    <fo:external-graphic display-align="center" scaling="uniform"
src="00000001.tif" />
  </fo:inline> 
  some text
  <fo:inline>
    <fo:external-graphic display-align="center" scaling="uniform"
src="00000001.tif" />
  </fo:inline> 
  some text
<fo:block>
but when there must be a new page or new string fop does not make it and my
image does not display correct in pdf (overflows visible area).
if i use fo:block instead of fo:inline all is good, but i have to use
fo:inline becouse if it is possible image must be displayed on the same
string.
thx:)
-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p26941207.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: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
or another example

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:m="http://www.w3.org/1998/Math/MathML"> 
<xsl:template match="/"> 
<fo:root xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
<fo:layout-master-set> 
<fo:simple-page-master master-name="my-page" page-height="29.7cm"
page-width="21cm" margin-top="0cm" margin-bottom="0cm" margin-left="0cm"
margin-right="0cm"> 
<fo:region-body column-count="2" margin-top="1.5cm" margin-bottom="1.5cm"
margin-left="1.5cm" margin-right="1.5cm" /> 
</fo:simple-page-master> 
</fo:layout-master-set> 
<fo:page-sequence master-reference="my-page"> 
<fo:flow flow-name="xsl-region-body"> 
<fo:block>
<fo:inline><fo:external-graphic display-align="center"
content-height="150mm" scaling="uniform" src="00000001.tif" /></fo:inline>​
<fo:inline><fo:external-graphic display-align="center"
content-height="150mm" scaling="uniform" src="00000001.tif" /></fo:inline>​
<fo:inline><fo:external-graphic display-align="center"
content-height="150mm" scaling="uniform" src="00000001.tif" /></fo:inline>​
<fo:inline><fo:external-graphic display-align="center"
content-height="150mm" scaling="uniform" src="00000001.tif" /></fo:inline>​
<fo:inline><fo:external-graphic display-align="center"
content-height="150mm" scaling="uniform" src="00000001.tif" /></fo:inline>​
<fo:inline><fo:external-graphic display-align="center"
content-height="150mm" scaling="uniform" src="00000001.tif" /></fo:inline>​												
</fo:block>
</fo:flow> 
</fo:page-sequence> 
</fo:root> 
</xsl:template> 
</xsl:stylesheet>


http://old.nabble.com/file/p27125610/name.pdf name.pdf 
http://old.nabble.com/file/p27125610/00000001.tif 00000001.tif 

what to do? help pls?
i MUST use fo:inline, not fo:block
-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27125610.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: howto center vertically an image in a text line (was: problem with fo:inline and fo:external-graphic, overflows)

Posted by Pascal Sancho <pa...@takoma.fr>.
Please, do not hijack another thread, open a new one for a new question.

To do that, you should use alignment-adjust property (or vertical-align,
witch is a shorthand property comprising alignment-adjust).
See REC XSL-FO §7.14.1 for further information at [1]

[1] http://www.w3.org/TR/xsl/#alignment-adjust

Pascal

lexa2009 a écrit :
> there is one more thing i want to ask. for example i have a string with
> inline image. how can i make that center of inline image will be on one
> level with text ? i explain what i want in image.
>
> http://old.nabble.com/file/p27338791/test.gif 
>   


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


Re: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
there is one more thing i want to ask. for example i have a string with
inline image. how can i make that center of inline image will be on one
level with text ? i explain what i want in image.

http://old.nabble.com/file/p27338791/test.gif 
-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27338791.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: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
YEAH. finally it works! guys, thank u a lot!
-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27335613.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: problem with fo:inline and fo:external-graphic, overflows

Posted by Pascal Sancho <pa...@takoma.fr>.
My bad!
I wrote "NBSP', but I should have written 'ZWSP':
 - NBSP stands for "non break space"
 - ZWSP stands for "zero width space"

In your XSL-FO, you just have to replace &#160; entities with &#x200b;
entities, and this will do the trick.

About English, no problem, this is not my native language either, like
many other FOP users ;-)

Pascal

lexa2009 a écrit :
> Pascal Sancho, thanks! i use fop 0-95. yes, i use msxsl.exe, then fop.
> please see my XSL-FO. i try to remove white-spaces and line-breaks and to
> insert NBSP before /and/ after each fo:external-graphic. but i still have
> all images and text on one line! i want no image overflows the available
> space as you wrote on your last post. sorry for my english, i am russian!
> fo:  http://old.nabble.com/file/p27335120/mystyle.fo mystyle.fo 
> pdf:  http://old.nabble.com/file/p27335120/name.pdf name.pdf 
> is this correct behavior ?
>
>  
>
> Pascal Sancho wrote:
>   
>> I've tried the XSL-FO nested in your XSLT (here [1])
>>  -> works fine
>> I've tried same code after removing *all* white-spaces and line-breaks
>> (I guess this is the actual XSL-FO code you get after XSLT transformation)
>>  -> all images are on the same line, witch is the correct behavior
>> I've inserted NBSP before /and/ after each fo:external-graphic:
>>  -> no image overflows the available space (a column in your case)
>>
>> These tests work fine with FOP 0.95 or TRUNK.
>> From my point of view, all this material (FOP and XSL-FO code) work as
>> expected.
>>
>> What FOP version are you using?
>>
>> Pascal
>>
>> [1]  http://old.nabble.com/file/p27302965/mystyle.fo
>>
>> lexa2009 a écrit :
>>     
>>> i try it before i write here. the problem is still insolved.


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


Re: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
Pascal Sancho, thanks! i use fop 0-95. yes, i use msxsl.exe, then fop.
please see my XSL-FO. i try to remove white-spaces and line-breaks and to
insert NBSP before /and/ after each fo:external-graphic. but i still have
all images and text on one line! i want no image overflows the available
space as you wrote on your last post. sorry for my english, i am russian!
fo:  http://old.nabble.com/file/p27335120/mystyle.fo mystyle.fo 
pdf:  http://old.nabble.com/file/p27335120/name.pdf name.pdf 
is this correct behavior ?

 

Pascal Sancho wrote:
> 
> I've tried the XSL-FO nested in your XSLT (here [1])
>  -> works fine
> I've tried same code after removing *all* white-spaces and line-breaks
> (I guess this is the actual XSL-FO code you get after XSLT transformation)
>  -> all images are on the same line, witch is the correct behavior
> I've inserted NBSP before /and/ after each fo:external-graphic:
>  -> no image overflows the available space (a column in your case)
> 
> These tests work fine with FOP 0.95 or TRUNK.
> From my point of view, all this material (FOP and XSL-FO code) work as
> expected.
> 
> What FOP version are you using?
> 
> Pascal
> 
> [1]  http://old.nabble.com/file/p27302965/mystyle.fo
> 
> lexa2009 a écrit :
>> i try it before i write here. the problem is still insolved.
>>   
> 
> 
> ---------------------------------------------------------------------
> 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://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27335120.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: problem with fo:inline and fo:external-graphic, overflows

Posted by Pascal Sancho <pa...@takoma.fr>.
I've tried the XSL-FO nested in your XSLT (here [1])
 -> works fine
I've tried same code after removing *all* white-spaces and line-breaks
(I guess this is the actual XSL-FO code you get after XSLT transformation)
 -> all images are on the same line, witch is the correct behavior
I've inserted NBSP before /and/ after each fo:external-graphic:
 -> no image overflows the available space (a column in your case)

These tests work fine with FOP 0.95 or TRUNK.
>From my point of view, all this material (FOP and XSL-FO code) work as
expected.

What FOP version are you using?

Pascal

[1]  http://old.nabble.com/file/p27302965/mystyle.fo

lexa2009 a écrit :
> i try it before i write here. the problem is still insolved.
>   


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


Re: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
i try it before i write here. the problem is still insolved.
-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27320151.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: problem with fo:inline and fo:external-graphic, overflows

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,

if you want to have a break opportunity between 2 images or between 1
image and some text, the best practice is to insert a Zero-Width-SPace
(ZWSP, &#x200b;) just before and/or after the image.

HTH,
Pascal


lexa2009 a écrit :
> hello. thx Vincent Hennebert-2, may be i am stupid but i still have a
> problem:)
>
> i use this fo(for example)
> <?xml version="1.0" encoding="UTF-8"?> 
> <xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
>         <xsl:template match="/"> 
>                 <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
>                         <fo:layout-master-set> 
>                                 <fo:simple-page-master master-name="my-page"
> page-height="29.7cm" page-width="21cm" margin-top="0cm" margin-bottom="0cm"
> margin-left="0cm" margin-right="0cm"> 
>                                         <fo:region-body column-count="2"
> margin-top="1.5cm" margin-bottom="1.5cm" margin-left="1.5cm"
> margin-right="1.5cm" /> 
>                                         
>                                 </fo:simple-page-master> 
>                                 
>                         </fo:layout-master-set> 
>                         
>                         <fo:page-sequence master-reference="my-page"> 
>                                                 <fo:flow
> flow-name="xsl-region-body"> 
>                                                 <fo:block>sometext1 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>       st2 
> 	  
> 	   <fo:external-graphic src="00000011.tif"
> content-width="scale-down-to-fit" 
>         inline-progression-dimension.maximum="100%"/>
> 		 <fo:external-graphic src="00000011.tif" content-width="scale-down-to-fit" 
>         inline-progression-dimension.maximum="100%"/>
> 		 <fo:external-graphic src="00000011.tif" content-width="scale-down-to-fit" 
>         inline-progression-dimension.maximum="100%"/>
> 		
> 		
> 		st11
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>         sometext2</fo:block>
>                                 </fo:flow> 
>                         </fo:page-sequence> 
>                 </fo:root> 
>         </xsl:template> 
> </xsl:stylesheet>
>
>
>
>
>
> Vincent Hennebert-2 wrote:
>   
>> That’s because the width of your image is greater than the page width.
>>
>>     
> when i use 
> <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
> 80mm is less then width of my page. but if i use 3 images then yes. so i
> want one of them move down.
>
>
>
> Vincent Hennebert-2 wrote:
>   
>>
>> You have to scale it down, for example:
>>     <fo:external-graphic src="image" content-width="scale-down-to-fit"
>>         inline-progression-dimension.maximum="100%"/>
>>
>>
>>     
> i try <fo:external-graphic src="00000011.tif"
> content-width="scale-down-to-fit" 
>         inline-progression-dimension.maximum="100%"/>
> but it overflows too! the right part of third image do not display
> correctly! and i want my image to be width 80mm, not random :)
>
> image  http://old.nabble.com/file/p27302965/00000011.tif 00000011.tif 
> fo document  http://old.nabble.com/file/p27302965/mystyle.fo mystyle.fo 
> output pdf  http://old.nabble.com/file/p27302965/name.pdf name.pdf 
>
>
>
> Vincent Hennebert-2 wrote:
>   
>> Hi,
>>
>> lexa2009 wrote:
>>     
>>> hi, thx for help. if i use 
>>> <fo:block>sometext1 
>>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>>> scaling="uniform" content-width="80mm"/> 
>>>       st2 
>>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>>> scaling="uniform" content-width="80mm"/> 
>>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>>> scaling="uniform" content-width="80mm"/> 
>>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>>> scaling="uniform" content-width="80mm"/> 
>>>         sometext2</fo:block>
>>>
>>> images still overflow my page. there is an example
>>> http://old.nabble.com/file/p27270558/name.pdf name.pdf 
>>>       
>> That’s because the width of your image is greater than the page width.
>> You have to scale it down, for example:
>>     <fo:external-graphic src="image" content-width="scale-down-to-fit"
>>         inline-progression-dimension.maximum="100%"/>
>>
>> HTH,
>> Vincent
>>     


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


Re: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
hello. thx Vincent Hennebert-2, may be i am stupid but i still have a
problem:)

i use this fo(for example)
<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
        <xsl:template match="/"> 
                <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> 
                        <fo:layout-master-set> 
                                <fo:simple-page-master master-name="my-page"
page-height="29.7cm" page-width="21cm" margin-top="0cm" margin-bottom="0cm"
margin-left="0cm" margin-right="0cm"> 
                                        <fo:region-body column-count="2"
margin-top="1.5cm" margin-bottom="1.5cm" margin-left="1.5cm"
margin-right="1.5cm" /> 
                                        
                                </fo:simple-page-master> 
                                
                        </fo:layout-master-set> 
                        
                        <fo:page-sequence master-reference="my-page"> 
                                                <fo:flow
flow-name="xsl-region-body"> 
                                                <fo:block>sometext1 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
      st2 
	  
	   <fo:external-graphic src="00000011.tif"
content-width="scale-down-to-fit" 
        inline-progression-dimension.maximum="100%"/>
		 <fo:external-graphic src="00000011.tif" content-width="scale-down-to-fit" 
        inline-progression-dimension.maximum="100%"/>
		 <fo:external-graphic src="00000011.tif" content-width="scale-down-to-fit" 
        inline-progression-dimension.maximum="100%"/>
		
		
		st11
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
        sometext2</fo:block>
                                </fo:flow> 
                        </fo:page-sequence> 
                </fo:root> 
        </xsl:template> 
</xsl:stylesheet>





Vincent Hennebert-2 wrote:
> 
> That’s because the width of your image is greater than the page width.
> 
when i use 
<fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
80mm is less then width of my page. but if i use 3 images then yes. so i
want one of them move down.



Vincent Hennebert-2 wrote:
> 
> 
> You have to scale it down, for example:
>     <fo:external-graphic src="image" content-width="scale-down-to-fit"
>         inline-progression-dimension.maximum="100%"/>
> 
> 

i try <fo:external-graphic src="00000011.tif"
content-width="scale-down-to-fit" 
        inline-progression-dimension.maximum="100%"/>
but it overflows too! the right part of third image do not display
correctly! and i want my image to be width 80mm, not random :)

image  http://old.nabble.com/file/p27302965/00000011.tif 00000011.tif 
fo document  http://old.nabble.com/file/p27302965/mystyle.fo mystyle.fo 
output pdf  http://old.nabble.com/file/p27302965/name.pdf name.pdf 



Vincent Hennebert-2 wrote:
> 
> Hi,
> 
> lexa2009 wrote:
>> hi, thx for help. if i use 
>> <fo:block>sometext1 
>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>> scaling="uniform" content-width="80mm"/> 
>>       st2 
>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>> scaling="uniform" content-width="80mm"/> 
>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>> scaling="uniform" content-width="80mm"/> 
>>       <fo:external-graphic src="00000011.tif" display-align="center" 
>> scaling="uniform" content-width="80mm"/> 
>>         sometext2</fo:block>
>> 
>> images still overflow my page. there is an example
>> http://old.nabble.com/file/p27270558/name.pdf name.pdf 
> 
> That’s because the width of your image is greater than the page width.
> You have to scale it down, for example:
>     <fo:external-graphic src="image" content-width="scale-down-to-fit"
>         inline-progression-dimension.maximum="100%"/>
> 
> HTH,
> Vincent
> 
> ---------------------------------------------------------------------
> 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://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27302965.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: problem with fo:inline and fo:external-graphic, overflows

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi,

lexa2009 wrote:
> hi, thx for help. if i use 
> <fo:block>sometext1 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>       st2 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>       <fo:external-graphic src="00000011.tif" display-align="center" 
> scaling="uniform" content-width="80mm"/> 
>         sometext2</fo:block>
> 
> images still overflow my page. there is an example
> http://old.nabble.com/file/p27270558/name.pdf name.pdf 

That’s because the width of your image is greater than the page width.
You have to scale it down, for example:
    <fo:external-graphic src="image" content-width="scale-down-to-fit"
        inline-progression-dimension.maximum="100%"/>

HTH,
Vincent


> Vincent Hennebert-2 wrote:
>>
>> I think you can get rid of fo:inline altogether:
>>     <fo:block>sometext1
>>       <fo:external-graphic src="00000011.tif" display-align="center"
>> scaling="uniform" content-width="80mm"/>
>>       st2
>>       <fo:external-graphic src="00000011.tif" display-align="center"
>> scaling="uniform" content-width="80mm"/>
>>       <fo:external-graphic src="00000011.tif" display-align="center"
>> scaling="uniform" content-width="80mm"/>
>>       <fo:external-graphic src="00000011.tif" display-align="center"
>> scaling="uniform" content-width="80mm"/>
>>         sometext2</fo:block>
>>
>> If you want the image to be on the same line as the preceding text, just
>> remove blanks between the two:
>>     <fo:block>sometext1<fo:external-graphic ...
>> (Although I’m not sure that this is correct behaviour. I think a break
>> should still be allowed to occur between the text and the image.)
>>
>> If you want no space between the preceding text and the image, yet the
>> image to be put on the next line if there is not enough space on the
>> current one, just insert a zero-width space:
>>     <fo:block>sometext1&#x200B;<fo:external-graphic ...
>>
>> And likewise for text following images, or between images.
>>
>> HTH,
>> Vincent
>>
>>
> 

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


Re: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
hi, thx for help. if i use 
<fo:block>sometext1 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
      st2 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
      <fo:external-graphic src="00000011.tif" display-align="center" 
scaling="uniform" content-width="80mm"/> 
        sometext2</fo:block>

images still overflow my page. there is an example
http://old.nabble.com/file/p27270558/name.pdf name.pdf 


Vincent Hennebert-2 wrote:
> 
> 
> I think you can get rid of fo:inline altogether:
>     <fo:block>sometext1
>       <fo:external-graphic src="00000011.tif" display-align="center"
> scaling="uniform" content-width="80mm"/>
>       st2
>       <fo:external-graphic src="00000011.tif" display-align="center"
> scaling="uniform" content-width="80mm"/>
>       <fo:external-graphic src="00000011.tif" display-align="center"
> scaling="uniform" content-width="80mm"/>
>       <fo:external-graphic src="00000011.tif" display-align="center"
> scaling="uniform" content-width="80mm"/>
>         sometext2</fo:block>
> 
> If you want the image to be on the same line as the preceding text, just
> remove blanks between the two:
>     <fo:block>sometext1<fo:external-graphic ...
> (Although I’m not sure that this is correct behaviour. I think a break
> should still be allowed to occur between the text and the image.)
> 
> If you want no space between the preceding text and the image, yet the
> image to be put on the next line if there is not enough space on the
> current one, just insert a zero-width space:
>     <fo:block>sometext1&#x200B;<fo:external-graphic ...
> 
> And likewise for text following images, or between images.
> 
> HTH,
> Vincent
> 
> 

-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27270558.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: problem with fo:inline and fo:external-graphic, overflows

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi,

What is your problem and what you want to achieve is not entirely clear
to me.

IIUC, you are not happy with the fact that the content is being rendered
on only one line and is being cut off at the page’s right margin? You
would like it to be broken into several lines, but images should be kept
with the preceding (or following?) text if possible.

I think you can get rid of fo:inline altogether:
    <fo:block>sometext1
      <fo:external-graphic src="00000011.tif" display-align="center"
scaling="uniform" content-width="80mm"/>
      st2
      <fo:external-graphic src="00000011.tif" display-align="center"
scaling="uniform" content-width="80mm"/>
      <fo:external-graphic src="00000011.tif" display-align="center"
scaling="uniform" content-width="80mm"/>
      <fo:external-graphic src="00000011.tif" display-align="center"
scaling="uniform" content-width="80mm"/>
        sometext2</fo:block>

If you want the image to be on the same line as the preceding text, just
remove blanks between the two:
    <fo:block>sometext1<fo:external-graphic ...
(Although I’m not sure that this is correct behaviour. I think a break
should still be allowed to occur between the text and the image.)

If you want no space between the preceding text and the image, yet the
image to be put on the next line if there is not enough space on the
current one, just insert a zero-width space:
    <fo:block>sometext1&#x200B;<fo:external-graphic ...

And likewise for text following images, or between images.

HTH,
Vincent


lexa2009 wrote:
> thx for help.
> here is my fo ( i cut it to show the problem):
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
> 			xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 				xmlns:m="http://www.w3.org/1998/Math/MathML">
> 	<xsl:template match="/">
> 		<fo:root xmlns:m="http://www.w3.org/1998/Math/MathML"
> xmlns:fo="http://www.w3.org/1999/XSL/Format">
> 			<fo:layout-master-set>
> 				<fo:simple-page-master master-name="my-page" page-height="29.7cm"
> page-width="21cm" margin-top="0cm" margin-bottom="0cm" margin-left="0cm"
> margin-right="0cm">
> 					<fo:region-body column-count="2" margin-top="1.5cm"
> margin-bottom="1.5cm" margin-left="1.5cm" margin-right="1.5cm" />
> 					
> 				</fo:simple-page-master>
> 				
> 			</fo:layout-master-set>
> 			
> 			<fo:page-sequence master-reference="my-page">
> 						<fo:flow flow-name="xsl-region-body">
> 						<fo:block>
> 						sometext1<fo:inline><fo:external-graphic src="00000011.tif"
> display-align="center" scaling="uniform" content-width="80mm">
> </fo:external-graphic></fo:inline>st2<fo:inline><fo:external-graphic
> src="00000011.tif" display-align="center" scaling="uniform"
> content-width="80mm">
> </fo:external-graphic></fo:inline><fo:inline><fo:external-graphic
> src="00000011.tif" display-align="center" scaling="uniform"
> content-width="80mm">
> </fo:external-graphic></fo:inline><fo:inline><fo:external-graphic
> src="00000011.tif" display-align="center" scaling="uniform"
> content-width="80mm"> </fo:external-graphic></fo:inline>sometext2
> 						</fo:block>
> 				</fo:flow>
> 			</fo:page-sequence>
> 		</fo:root>
> 	</xsl:template>
> </xsl:stylesheet>
> i use fop 0.95 but with fix of tiff. ( my theme
> http://old.nabble.com/error-in-pdf-with-tiff-image-inside-which-was-created-by-fop-td26509340.html
> )
> i want to see all my images. yes, if i use fo:block all will be ok, but i
> need image on one string with text if possible.
> http://old.nabble.com/file/p27109532/name.pdf name.pdf 
> http://old.nabble.com/file/p27109532/00000011.tif 00000011.tif 
> here pdf and image that i use.
>  

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


Re: problem with fo:inline and fo:external-graphic, overflows

Posted by lexa2009 <my...@gmail.com>.
thx for help.
here is my fo ( i cut it to show the problem):
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
			xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:m="http://www.w3.org/1998/Math/MathML">
	<xsl:template match="/">
		<fo:root xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
			<fo:layout-master-set>
				<fo:simple-page-master master-name="my-page" page-height="29.7cm"
page-width="21cm" margin-top="0cm" margin-bottom="0cm" margin-left="0cm"
margin-right="0cm">
					<fo:region-body column-count="2" margin-top="1.5cm"
margin-bottom="1.5cm" margin-left="1.5cm" margin-right="1.5cm" />
					
				</fo:simple-page-master>
				
			</fo:layout-master-set>
			
			<fo:page-sequence master-reference="my-page">
						<fo:flow flow-name="xsl-region-body">
						<fo:block>
						sometext1<fo:inline><fo:external-graphic src="00000011.tif"
display-align="center" scaling="uniform" content-width="80mm">
</fo:external-graphic></fo:inline>st2<fo:inline><fo:external-graphic
src="00000011.tif" display-align="center" scaling="uniform"
content-width="80mm">
</fo:external-graphic></fo:inline><fo:inline><fo:external-graphic
src="00000011.tif" display-align="center" scaling="uniform"
content-width="80mm">
</fo:external-graphic></fo:inline><fo:inline><fo:external-graphic
src="00000011.tif" display-align="center" scaling="uniform"
content-width="80mm"> </fo:external-graphic></fo:inline>sometext2
						</fo:block>
				</fo:flow>
			</fo:page-sequence>
		</fo:root>
	</xsl:template>
</xsl:stylesheet>
i use fop 0.95 but with fix of tiff. ( my theme
http://old.nabble.com/error-in-pdf-with-tiff-image-inside-which-was-created-by-fop-td26509340.html
)
i want to see all my images. yes, if i use fo:block all will be ok, but i
need image on one string with text if possible.
http://old.nabble.com/file/p27109532/name.pdf name.pdf 
http://old.nabble.com/file/p27109532/00000011.tif 00000011.tif 
here pdf and image that i use.
 
-- 
View this message in context: http://old.nabble.com/problem-with-fo%3Ainline-and-fo%3Aexternal-graphic%2C-overflows-tp26941207p27109532.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: problem with fo:inline and fo:external-graphic, overflows

Posted by Pascal Sancho <pa...@takoma.fr>.
Hi,
I cannot reproduce different behavior when using fo:block instead of 
fo:inline with provided material.
You should be more explicit: actual XSL-FO code for both cases, and if 
possible actual image file used.
However, I suspect you are using an old FOP version, can you check that?

Note that FOP 0.95 conforms to the spec (see REC §6.6.5 - 
fo:external-graphic,  at [1]), while FOP 0.2x doesn't:
 - actual size of the image is calculated regarding intrinsic image size 
and content-* size properties for the fo:e-g
 - if not directly available, the intrinsic size is calculated using the 
source resolution (see [2])

Usual script should be, assuming a lr-tb writing-mode:

<fo:external-graphic src="my_graphic_url"
    inline-progression-dimension="my_viewport_width"
    block-progression-dimension="my_viewport_height"
    content-width="my_image_width"
    content-width="my_image_height"/>

see also, for further details:
REC §7.15.3 block-progression-dimension at [3]
REC §7.15.4 content-height at [4]
REC §7.15.5 content-width at [5]
REC §7.15.7 inline-progression-dimension at [6]

[1] http://www.w3.org/TR/xsl/#fo_external-graphic
[2] http://xmlgraphics.apache.org/fop/0.95/graphics.html#resolution
[3] http://www.w3.org/TR/xsl/#block-progression-dimension
[4] http://www.w3.org/TR/xsl/#content-height
[5] http://www.w3.org/TR/xsl/#content-width
[6] http://www.w3.org/TR/xsl/#inline-progression-dimension

HTH,
Pascal



lexa2009 a écrit :
> hello. i want to generate pdf with text and some images inside it.
> for example this part of fo
> <fo:block>
>   sometext
>   <fo:inline>
>     <fo:external-graphic display-align="center" scaling="uniform"
> src="00000001.tif" />
>   </fo:inline> 
>   some text
>   <fo:inline>
>     <fo:external-graphic display-align="center" scaling="uniform"
> src="00000001.tif" />
>   </fo:inline> 
>   some text
> <fo:block>
> but when there must be a new page or new string fop does not make it and my
> image does not display correct in pdf (overflows visible area).
> if i use fo:block instead of fo:inline all is good, but i have to use
> fo:inline becouse if it is possible image must be displayed on the same
> string.
> thx:)


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