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 BEGUE Pierre <pb...@iftechnologies.net> on 2005/07/20 11:37:32 UTC

setAttribut

hi Thomas,

i do a copy svg to svg with the svgTranscoder and into the copy i want 
to change the attribut by svgRoot.setAttribut(). But he don't change the 
attribut

this my code :

//declaration variable
     String Entree = "batik3D.svg";
     String Sortie = "SortieFlux.svg";
     //String rep = "c:/pierrestage/WebApplication3/build/web/Lege/";
     String rep = "c:/batik/batik/samples/";


     //Creation d un SVG transcoder
     SVGTranscoder t = new SVGTranscoder();

     // Creation d un transcoder input
     //String svgURI = new File(rep+Entree).toURL().toString();
     FileInputStream instream = new FileInputStream(rep+Entree);
     InputStreamReader istream  = new InputStreamReader(instream);
     TranscoderInput input = new TranscoderInput(istream);

     // Creation d un transcoder output
     /*OutputStream ostream */
     FileOutputStream outstream = new FileOutputStream(rep+Sortie);
     OutputStreamWriter ostream = new OutputStreamWriter(outstream);
     TranscoderOutput output = new TranscoderOutput(ostream);

     // Sauvegarde de l image
     t.transcode(input,output);


     String svgURI = new File(rep+Sortie).toURL().toString();


     //methode de recuperation du document
     String parser = XMLResourceDescriptor.getXMLParserClassName();
     SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
     Document doc = f.createDocument(svgURI);

     //recuepere l element root de mon document svg
     Element svgRoot = doc.getDocumentElement();

     //je lui affecte les attributs
     //String viewBoxAtt = (String) request.getParameter("viewBox");

     /* ++++ UTILISATION SEULE D ECRITURE AVEC DOCUMENT ++++*/
     String moi = svgRoot.getAttributeNS(null,"width");
     out.println("width = "+moi);
     svgRoot.setAttribute("width","350");
     svgRoot.setAttributeNS(null, "height","400");
     //svgRoot.setAttributeNS(SVGURI, "viewBox",viewBoxAtt);



why , can you explain me, thanks


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


Re: setAttribut

Posted by BEGUE Pierre <pb...@iftechnologies.net>.
hi thomas

how to use the method of getURLDone in the class 
org.apache.batik.script(Window.URLResponseHandler)

thanks




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


Re: setAttribut

Posted by BEGUE Pierre <pb...@iftechnologies.net>.
hi thomas

how to use the method of getURLDone in the class 
org.apache.batik.script(Window.URLResponseHandler)

thanks


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