xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Swapan Golla <sgo...@yahoo.com>
Subject RE: TextFlow
Date Tue, 04 Mar 2003 23:32:26 GMT
I did put the batik-extension.jar, batik-svg-dom.jar
in the classpath and then tried to convert into pdf.
If I externally reference the svg file, everything
works fine but if I embed the svg file in my fo
document, it produces a blank pdf with the following
errors:

Unknown Formatting Object
http://xml.apache.org/batik/ext^flowText
Unknown Formatting Object
http://xml.apache.org/batik/ext^flowRegion
Unknown Formatting Object
http://xml.apache.org/batik/ext^region

and so on.

How can the same svg work well when externally
referenced but not work when embedded in an fo
document? Can anybody help ? 

Swapan.

// FO DOCUMENT 



<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:html="http://doctype.gallup.com/g/namespace/html"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:fox="http://xml.apache.org/fop/extensions" >			
	<fo:layout-master-set>				
		<fo:simple-page-master master-name="individual_page"
page-height="29.7cm"
				page-width="21cm" margin-top="2.0cm"
margin-bottom="2.0cm"
				margin-left="2.5cm" margin-right="2.5cm">					
			<fo:region-body margin-top="0.5cm"
margin-bottom="0.5cm"/>					
			<fo:region-before extent="0.5cm"/>					
			<fo:region-after extent="0.5cm"/>				
		</fo:simple-page-master>				
	</fo:layout-master-set>
	
	<fo:page-sequence master-reference="individual_page">
		<fo:flow flow-name="xsl-region-body"
break-after="page" >

		<fo:instream-foreign-object>
					<svg:svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:batik="http://xml.apache.org/batik/ext"
id="body" width="450" height="500" viewBox="0 0 450
500">
					<svg:title>Test of Text wrapping
stuff.</svg:title>
							<svg:g id="content" >
					
					      <svg:text class="title" x="50%" y="40">Test
of Text wrapping stuff</svg:text>
					         <!-- Space after size 40 'that' is aci
45 -->
					      <svg:rect x="17"  y="80" width="200"
height="400" fill="rgb(220,220,255)"/>
					      <svg:rect x="233" y="80" width="200"
height="400" fill="rgb(220,220,255)"/>
					
					      <svg:line x1="27"  y1="70" x2="27" 
y2="490" stroke="grey" fill="none"/>
					      <svg:line x1="207" y1="70" x2="207"
y2="490" stroke="grey" fill="none"/>
					      <svg:line x1="243" y1="70" x2="243"
y2="490" stroke="grey" fill="none"/>
					      <svg:line x1="423" y1="70" x2="423"
y2="490" stroke="grey" fill="none"/>
					
					      <batik:flowText
xmlns:batik="http://xml.apache.org/batik/ext"
						            font-size="20" xml:space="preserve">
						<batik:flowRegion>
						    <batik:region x="17"  y="80" width="200"
height="400"/>
						    <batik:region x="233" y="80" width="200"
height="400"/>
						</batik:flowRegion>
						
						
						<batik:flowDiv>
						    <batik:flowPara first-line-left-margin="20"
bottom-margin="10" >This is an <batik:flowSpan
font-size="40"
fill="crimson">ex&#x00AD;ample</batik:flowSpan> of a
very long string that is split &#x200D;across
multi&#x00AD;ple lines via text
wrap&#x0AD;ping.</batik:flowPara>
						    <batik:flowPara justification="middle"
top-margin="10" left-margin="10" right-margin="10"
bottom-margin="10"><batik:flowLine>Now check if text
wrapping handles a number of tricky</batik:flowLine>
situations:
averylongrunonwordthatspansmultiplelines<batik:flowSpan
font-weight="bold">with<batik:flowSpan
fill="crimson">embedded</batik:flowSpan>span</batik:flowSpan>elements
&amp; <batik:flowSpan fill="green" dy="-.3em"
font-size="80%">super</batik:flowSpan><batik:flowSpan
dy=".3em"> or </batik:flowSpan><batik:flowSpan
fill="darkgreen" dy=".3em"
font-size="80%">sub</batik:flowSpan><batik:flowSpan
dy="-.3em"> scripts.</batik:flowSpan></batik:flowPara>
						    <batik:flowPara top-margin="10"
justification="end">Now we are just <batik:flowSpan
font-size="30" fill="blue">about</batik:flowSpan> to
go to the next flow rect <batik:flowSpan
font-size="10">(note if the 'about' were included on
the last line of the previous flow rect the line would
not have fit and the whole line would have moved
here).</batik:flowSpan></batik:flowPara>
						    <batik:flowPara margin="10"
justification="full">     I'll keep going because I
want to make sure that it properly stops when it hits
the end of all of the the flow regions defined. Also
the last line includes text in a larger font size so
it will not fit. Thus the end of this sentence will be
cut off because the line size gets <batik:flowSpan
font-size="35">tall</batik:flowSpan>er</batik:flowPara>
						</batik:flowDiv>
					
						
					      </batik:flowText>
					   </svg:g>	
					
					</svg:svg>
		</fo:instream-foreign-object>


		</fo:flow>
	</fo:page-sequence>
</fo:root>






--- Thomas E Deweese <thomas.deweese@kodak.com> wrote:
> >>>>> "SG" == Swapan Golla <sgolla@yahoo.com>
> writes:
> 
> SG> I am trying to transform the flowText.svg given
> in the
> SG> samples/extensions directory and transforming
> into pdf and it is
> SG> producing me a pdf without any text. Is there
> anything that I
> SG> should do specially to incorporate the text
> wrapping stuff into my
> SG> pdf ?
> 
>     I've never tried to do this, however I am
> surprised at this result
> since from the pdf converters point of view the
> flowText is
> indistinguishable from other SVG text.
> 
>     Can you view your SVG in the browser?
> 
>     Are you including the extensions on your
> classpath?  Normally we
> do not include the extensions in the class path for
> our tools since
> they are not conformant SVG (at least not yet).
> 
>     All of which get's to how are you invoking the
> pdf transcoder?
> 
> SG> Swapan.
> 
> SG>
> __________________________________________________
> Do you Yahoo!?
> SG> Yahoo! Tax Center - forms, calculators, tips,
> more
> SG> http://taxes.yahoo.com/
> 
> SG>
>
---------------------------------------------------------------------
> SG> To unsubscribe, e-mail:
> batik-users-unsubscribe@xml.apache.org For
> SG> additional commands, e-mail:
> batik-users-help@xml.apache.org
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> batik-users-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

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


Mime
View raw message