You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Jihai Qiu <ji...@cs.nyu.edu> on 2003/09/01 22:16:55 UTC

[Q] text background color and multiple line breaks

Hi,

I need to implement the HTML <div> inside <table> into pdf. Because fop
does not support it, I have to convert the HTML <div>'s with absolute
position into SVG as the frist step.

I encountered two problems and would like to ask you.

The first is about the text background color, especially when converting
<html::span> to <svg:flowLine>. I am unable to set background color.
Is there any workaround? Can I use script to set it?

The second is for the multiple line breaks(<br>'s). The SVG V1.2 spec
mentions that "if there are no printing characters between the end of
multiple flowline elements the second and greater flowLine elements have
no effect as the current line does not contain any text when they are
processed". Is there any simple way to implement multiple line breaks.

Thank you very much.

Jay


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


Re: [Q] text background color and multiple line breaks

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Jihai,

Jihai Qiu wrote:
> Is it possible to use some script to set the background color? I sew some
> message mentioned about getBBox() and then set color on the SVGRect
> object. But I am not sure if it is feasible.

    You can look at the 'locatable' and 'text content' interfaces in the
SVG specification these can provide the type of information you need.
But there are some problems, first the text content interface isn't
implemented for the flow text stuff, second just using getBBox doesn't
work for wrapped text since you will really want a rect for each line
of the text (and it is only available on the flowText element).

    I'm afraid you will probably need to punt on this requirement
or make some significant additions to the existing implementaiton of
flow text (I don't think implementing the Text Content stuff would be
too hard for flow text but the current implementation is likely to
be replaced eventually with a more conformant implementation that
handles arbitrary flow regions, BIDI, vertical text, etc).

> Can you also give some more detailed informatin about how to use the
> "preformatted" attribute? Can I just use <flowLine preformatted="true"/>?
> I can not find any document on Batik extensions except W3C SVG 1.2 spec.

    Yes.  There isn't much documentation as these were mostly done to
vet proposals for new features in SVG - in general eventually they will
either be depricated or made part of the SVG specification.

> Your help is greatly appreciated.

    Your welcome, such as it is :)

> 
> Jay
> 
> 
> On Tue, 2 Sep 2003, Thomas DeWeese wrote:
> 
> 
>>Hi Jihai,
>>
>>Jihai Qiu wrote:
>>
>>
>>>I need to implement the HTML <div> inside <table> into pdf. Because fop
>>>does not support it, I have to convert the HTML <div>'s with absolute
>>>position into SVG as the frist step.
>>>
>>>I encountered two problems and would like to ask you.
>>>
>>>The first is about the text background color, especially when converting
>>><html::span> to <svg:flowLine>. I am unable to set background color.
>>>Is there any workaround? Can I use script to set it?
>>
>>   There is no background for SVG text.  You can create an svg rectangle that
>>covers the background area for the text (this would be hard for spans :).
>>
>>
>>>The second is for the multiple line breaks(<br>'s). The SVG V1.2 spec
>>>mentions that "if there are no printing characters between the end of
>>>multiple flowline elements the second and greater flowLine elements have
>>>no effect as the current line does not contain any text when they are
>>>processed". Is there any simple way to implement multiple line breaks.
>>
>>   You might try using the 'preformatted' attribute.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>For 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
> 
> 




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


Re: [Q] text background color and multiple line breaks

Posted by Jihai Qiu <ji...@cs.nyu.edu>.
Thank you Thomas,

Is it possible to use some script to set the background color? I sew some
message mentioned about getBBox() and then set color on the SVGRect
object. But I am not sure if it is feasible.

Can you also give some more detailed informatin about how to use the
"preformatted" attribute? Can I just use <flowLine preformatted="true"/>?
I can not find any document on Batik extensions except W3C SVG 1.2 spec.

Your help is greatly appreciated.

Jay


On Tue, 2 Sep 2003, Thomas DeWeese wrote:

> Hi Jihai,
>
> Jihai Qiu wrote:
>
> > I need to implement the HTML <div> inside <table> into pdf. Because fop
> > does not support it, I have to convert the HTML <div>'s with absolute
> > position into SVG as the frist step.
> >
> > I encountered two problems and would like to ask you.
> >
> > The first is about the text background color, especially when converting
> > <html::span> to <svg:flowLine>. I am unable to set background color.
> > Is there any workaround? Can I use script to set it?
>
>    There is no background for SVG text.  You can create an svg rectangle that
> covers the background area for the text (this would be hard for spans :).
>
> > The second is for the multiple line breaks(<br>'s). The SVG V1.2 spec
> > mentions that "if there are no printing characters between the end of
> > multiple flowline elements the second and greater flowLine elements have
> > no effect as the current line does not contain any text when they are
> > processed". Is there any simple way to implement multiple line breaks.
>
>    You might try using the 'preformatted' attribute.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For 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


Re: [Q] text background color and multiple line breaks

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Jihai,

Jihai Qiu wrote:

> I need to implement the HTML <div> inside <table> into pdf. Because fop
> does not support it, I have to convert the HTML <div>'s with absolute
> position into SVG as the frist step.
> 
> I encountered two problems and would like to ask you.
> 
> The first is about the text background color, especially when converting
> <html::span> to <svg:flowLine>. I am unable to set background color.
> Is there any workaround? Can I use script to set it?

   There is no background for SVG text.  You can create an svg rectangle that
covers the background area for the text (this would be hard for spans :).

> The second is for the multiple line breaks(<br>'s). The SVG V1.2 spec
> mentions that "if there are no printing characters between the end of
> multiple flowline elements the second and greater flowLine elements have
> no effect as the current line does not contain any text when they are
> processed". Is there any simple way to implement multiple line breaks.

   You might try using the 'preformatted' attribute.



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