List Info

Thread: Using SVG1.2 (FlowText)




Using SVG1.2 (FlowText)
country flaguser name
United Kingdom
2007-10-10 12:51:36

All,

 

I’m trying to use batik 1.7 (jvm 1.5) embed in my program to transcode svg contents into image. Inside the contents I’ve the svg 1.2 flowtext (element with respective subelements) mixed with others. All the svg1.0 elements are displayed correctly, but 1.2 not. The code chunk̵7;s are presented above, some one can help?

 

UserAgentAdapter userAgent=new UserAgentAdapter();

            ctx=new SVG12BridgeContext(

                        userAgent, null, new DocumentLoader(userAgent));

           

            builder=new DynamicGVTBuilder();

            ctx.setDynamicState(SVG12BridgeContext.DYNAMIC);

            GraphicsNode gvt=builder.build(ctx, document);

           

 

            //creating the text element

            final Element element=((SVG12OMDocument)doc).createElementNS("http://xml.apache.org/batik/ext"

                        /*doc.getDocumentElement().getNamespaceURI()*/,

                              handledElementTagName);

            element.setAttribute("xmlns", "http://xml.apache.org/batik/ext");

 

            //creating the text node

            Text textValue=doc.createTextNode(text);

            Element fr=doc.createElement("flowRegion";);

            Element rt=doc.createElement("rect");

            EditorToolkit.setAttributeValue(rt,"x",10);

            EditorToolkit.setAttributeValue(rt,"y",10);

            EditorToolkit.setAttributeValue(rt,"width",200);

            EditorToolkit.setAttributeValue(rt,"height",200);

            fr.appendChild(rt);

            element.appendChild(fr);

            Element fd=doc.createElement("flowDiv");

            Element fp=doc.createElement("flowPara");

            fp.appendChild(textValue);

            fd.appendChild(fp);

            element.appendChild(fd);

 

 

 

Cumprimentos,

Loureiro, Gil

Document Engineering Manager

Document Services

_________________________________________

Edinfor - a LogicaCMG company

Rua Particular da EDP (à rua cidade Goa nº11), 2685 Sacavém

Portugal

M: +351 93 741 8888

E: edinfor.logicacmg.com" title="mailto:gil.loureiroedinfor.logicacmg.com">edinfor.logicacmg.com">gil.loureiroedinfor.logicacmg.com

www.edinfor.logicacmg.com

 



Este e-mail e quaisquer anexos com ele transmitidos são destinados exclusivamente às pessoas nele endereçadas, os quais poderão conter informação legalmente protegida, confidencial ou sigilosa. Não deverá fazer qualquer cópia desta mensagem, utilizá-la para qualquer fim ou transmitir o seu conteúdo a terceiros. Caso tenha recebido este e-mail indevidamente, por favor apague-o definitivamente do seu sistema sem o copiar e informe o respectivo remetente. Obrigado.
Re: Using SVG1.2 (FlowText)
country flaguser name
United States
2007-10-11 05:54:59
Being new to Batik and SVG I can only give you a guess as to
what is wrong
but one thing is that you have set it to use the batik
extensions for
flowtext, not the SVG1.2 version, if you use the namespace
as
"SVG12DOMImplementation.SVG_NAMESPACE_URI" then I
think it would work
better, also you need to set the svgRoot node to have
version = 1.2 as one
of its attributes, svgRoot.setAttributeNS(null,
"version", "1.2"); if it
isn't already.

Hope that helps you and if not I'm sure some people with
more experience
will be able to help when they see the message.

Jon


Gil Loureiro wrote:
> 
> All,
> 
>  
> 
> I'm trying to use batik 1.7 (jvm 1.5) embed in my
program to transcode svg
> contents into image. Inside the contents I've the svg
1.2 flowtext
> (element with respective subelements) mixed with
others. All the svg1.0
> elements are displayed correctly, but 1.2 not. The code
chunk's are
> presented above, some one can help? 
> 
>  
> 
> ...
> 
> UserAgentAdapter userAgent=new UserAgentAdapter();
> 
>             ctx=new SVG12BridgeContext(
> 
>                         userAgent, null, new
DocumentLoader(userAgent));
> 
>             
> 
>             builder=new DynamicGVTBuilder();
> 
>            
ctx.setDynamicState(SVG12BridgeContext.DYNAMIC);
> 
>             GraphicsNode gvt=builder.build(ctx,
document);
> 
> ...
> 
>             
> 
>  
> 
> ...
> 
>             //creating the text element
> 
>             final Element
> element=((SVG12OMDocument)doc).createElementNS("http://xml.apac
he.org/batik/ext"
> 
>                        
/*doc.getDocumentElement().getNamespaceURI()*/, 
> 
>                               handledElementTagName);
> 
>             element.setAttribute("xmlns",
> "http://xml.apac
he.org/batik/ext");
> 
>  
> 
>             //creating the text node
> 
>             Text textValue=doc.createTextNode(text);
> 
>             Element
fr=doc.createElement("flowRegion");
> 
>             Element
rt=doc.createElement("rect");
> 
>            
EditorToolkit.setAttributeValue(rt,"x",10);
> 
>            
EditorToolkit.setAttributeValue(rt,"y",10);
> 
>            
EditorToolkit.setAttributeValue(rt,"width",200);
> 
>            
EditorToolkit.setAttributeValue(rt,"height",200);
> 
>             fr.appendChild(rt);
> 
>             element.appendChild(fr);
> 
>             Element
fd=doc.createElement("flowDiv");
> 
>             Element
fp=doc.createElement("flowPara");
> 
>             fp.appendChild(textValue);
> 
>             fd.appendChild(fp);
> 
>             element.appendChild(fd);
> 
> ...
> 
>  
> 
>  
> 
>  
> 
> Cumprimentos,
> 
> Loureiro, Gil
> 
> Document Engineering Manager
> 
> Document Services
> 
> _________________________________________
> 
> Edinfor - a LogicaCMG company
> 
> Rua Particular da EDP (à rua cidade Goa nº11), 2685
Sacavém
> 
> Portugal
> 
> M: +351 93 741 8888
> 
> E: gil.loureiroedinfor.logicacmg.com
> <BLOCKED::mailto:gil.loureiroedinfor.logicacmg.com> 
> 
> www.edinfor.logicacmg.com <BLOCKED::http://www.edin
for.logicacmg.com/> 
> 
>  
> 
> 
> 
> Este e-mail e quaisquer anexos com ele transmitidos
são destinados
> exclusivamente às pessoas nele endereçadas, os quais
poderão conter
> informação legalmente protegida, confidencial ou
sigilosa. Não deverá
> fazer qualquer cópia desta mensagem, utilizá-la para
qualquer fim ou
> transmitir o seu conteúdo a terceiros. Caso tenha
recebido este e-mail
> indevidamente, por favor apague-o definitivamente do
seu sistema sem o
> copiar e informe o respectivo remetente. Obrigado.
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-SVG1.2-%28
FlowText%29-tf4602462.html#a13153499
Sent from the Batik - Users mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org


Re: Using SVG1.2 (FlowText)
country flaguser name
United States
2007-10-11 05:56:55
Sorry to send again so quickly but just realised the
namespace might have
been misunderstood, I meant that as the code, not as the
string containing
SVG12DOMImplementation.SVG_NAMESPACE_URI (so if you had a
variable to hold
the namespace URI you would have:

String svgNS = SVG12DOMImplementation.SVG_NAMESPACE_URI;

Hopefully that makes more sense.

Jon



poozle wrote:
> 
> Being new to Batik and SVG I can only give you a guess
as to what is wrong
> but one thing is that you have set it to use the batik
extensions for
> flowtext, not the SVG1.2 version, if you use the
namespace as
> "SVG12DOMImplementation.SVG_NAMESPACE_URI"
then I think it would work
> better, also you need to set the svgRoot node to have
version = 1.2 as one
> of its attributes, svgRoot.setAttributeNS(null,
"version", "1.2"); if it
> isn't already.
> 
> Hope that helps you and if not I'm sure some people
with more experience
> will be able to help when they see the message.
> 
> Jon
> 
> 
> Gil Loureiro wrote:
>> 
>> All,
>> 
>>  
>> 
>> I'm trying to use batik 1.7 (jvm 1.5) embed in my
program to transcode
>> svg contents into image. Inside the contents I've
the svg 1.2 flowtext
>> (element with respective subelements) mixed with
others. All the svg1.0
>> elements are displayed correctly, but 1.2 not. The
code chunk's are
>> presented above, some one can help? 
>> 
>>  
>> 
>> ...
>> 
>> UserAgentAdapter userAgent=new UserAgentAdapter();
>> 
>>             ctx=new SVG12BridgeContext(
>> 
>>                         userAgent, null, new
DocumentLoader(userAgent));
>> 
>>             
>> 
>>             builder=new DynamicGVTBuilder();
>> 
>>            
ctx.setDynamicState(SVG12BridgeContext.DYNAMIC);
>> 
>>             GraphicsNode gvt=builder.build(ctx,
document);
>> 
>> ...
>> 
>>             
>> 
>>  
>> 
>> ...
>> 
>>             //creating the text element
>> 
>>             final Element
>>
element=((SVG12OMDocument)doc).createElementNS("http://xml.apac
he.org/batik/ext"
>> 
>>                        
/*doc.getDocumentElement().getNamespaceURI()*/, 
>> 
>>                              
handledElementTagName);
>> 
>>            
element.setAttribute("xmlns",
>> "http://xml.apac
he.org/batik/ext");
>> 
>>  
>> 
>>             //creating the text node
>> 
>>             Text
textValue=doc.createTextNode(text);
>> 
>>             Element
fr=doc.createElement("flowRegion");
>> 
>>             Element
rt=doc.createElement("rect");
>> 
>>            
EditorToolkit.setAttributeValue(rt,"x",10);
>> 
>>            
EditorToolkit.setAttributeValue(rt,"y",10);
>> 
>>            
EditorToolkit.setAttributeValue(rt,"width",200);
>> 
>>            
EditorToolkit.setAttributeValue(rt,"height",200);
>> 
>>             fr.appendChild(rt);
>> 
>>             element.appendChild(fr);
>> 
>>             Element
fd=doc.createElement("flowDiv");
>> 
>>             Element
fp=doc.createElement("flowPara");
>> 
>>             fp.appendChild(textValue);
>> 
>>             fd.appendChild(fp);
>> 
>>             element.appendChild(fd);
>> 
>> ...
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>> Cumprimentos,
>> 
>> Loureiro, Gil
>> 
>> Document Engineering Manager
>> 
>> Document Services
>> 
>> _________________________________________
>> 
>> Edinfor - a LogicaCMG company
>> 
>> Rua Particular da EDP (à rua cidade Goa nº11),
2685 Sacavém
>> 
>> Portugal
>> 
>> M: +351 93 741 8888
>> 
>> E: gil.loureiroedinfor.logicacmg.com
>> <BLOCKED::mailto:gil.loureiroedinfor.logicacmg.com> 
>> 
>> www.edinfor.logicacmg.com <BLOCKED::http://www.edin
for.logicacmg.com/> 
>> 
>>  
>> 
>> 
>> 
>> Este e-mail e quaisquer anexos com ele transmitidos
são destinados
>> exclusivamente às pessoas nele endereçadas, os
quais poderão conter
>> informação legalmente protegida, confidencial ou
sigilosa. Não deverá
>> fazer qualquer cópia desta mensagem, utilizá-la
para qualquer fim ou
>> transmitir o seu conteúdo a terceiros. Caso tenha
recebido este e-mail
>> indevidamente, por favor apague-o definitivamente
do seu sistema sem o
>> copiar e informe o respectivo remetente. Obrigado.
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Using-SVG1.2-%28
FlowText%29-tf4602462.html#a13153523
Sent from the Batik - Users mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )