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 Bastien DEBLAIS <bd...@iftechnologies.net> on 2005/06/30 13:52:45 UTC

Re: RE:help me please clipping svg (see it thomas)

re Thomas
i already send an message before with my code see it
just to tell ma how to save the clipping in an another svg


thanks




----- Original Message ----- 
From: <wo...@free.fr>
Newsgroups: gmane.text.xml.batik.user
Sent: Thursday, June 30, 2005 12:50 PM
Subject: RE:help me please clipping svg


> ok but
> for my job, the entreprise show a region ( "departement","comune" of a
french
> city)
>
> And i want to save an area of the map and save it into an another svg
> document.(clipping)
> give an example of a this because i think can't understand easily.
>
> thanks for all




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


Re: help me please clipping svg (see it thomas)

Posted by Bastien DEBLAIS <bd...@iftechnologies.net>.
When i code what you and with input.getDocument()

i have this code error :
org.apache.jasper.JasperException: domFactory should not be null


and the domFactory its the doc when i use it in th graphics2D



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


Re: help me please clipping svg (see it thomas)

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

Bastien DEBLAIS wrote:
> This my new code of clipping
> but i cant associat the SVGGraphics2D with my svgreader
> see and tell me if my clipping is good and if something must be coded

    You need to build the GVT tree and call the paint method on the
root SVG element:

import org.apache.batik.bridge.UserAgent;
import org.apache.batik.bridge.UserAgentAdapter;
import org.apache.batik.bridge.DocumentLoader;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.gvt.GraphicsNode;


	SVGDocument    svgDoc;
         UserAgent      userAgent;
         DocumentLoader loader;
         BridgeContext  ctx;
         GVTBuilder     builder;
	GraphicsNode   gn;

         userAgent = new UserAgentAdapter();
         loader    = new DocumentLoader(userAgent);
	ctx       = new BridgeContext(userAgent, loader);
         builder   = new GVTBuilder();
         gn        = builder.build(ctx, svgDoc);
	gn.paint(svgGraphics2D);

         svgGraphics2D.stream(....);

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


Re: RE:help me please clipping svg (see it thomas)

Posted by Bastien DEBLAIS <bd...@iftechnologies.net>.
This my new code of clipping
but i cant associat the SVGGraphics2D with my svgreader
see and tell me if my clipping is good and if something must be coded

/***********************************/




//int width = Integer.parseInt(parama);
          //int height = Integer.parseInt(paramb);

          SVGTranscoder trans = new SVGTranscoder();


          // Creation d un transcoder input
          FileInputStream instream = new FileInputStream(rep+Entree);
          InputStreamReader istream  = new InputStreamReader(instream);
          TranscoderInput input = new TranscoderInput(istream);

          String svgURI = new File(rep+Entree).toURL().toString();
          TranscoderInput input1 = new TranscoderInput(svgURI);


          //recupere le document pour le clipper
          Document doc = input1.getDocument();

          String moi = input1.getURI();
          out.println("moi = " + moi);

          //erreur dom factory should not be null->mon doc quand je le
recupere doit etre null
          //comment lire un fichier puis lui associe une action
          //construction du graphics2D mais associe avec le document ouvert




          SVGGraphics2D sg2D = new SVGGraphics2D(doc);
          sg2D.setClip(0,0,100,100);

          sg2D.stream(rep+Sortie);


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

          out.println("fichier " + Sortie + " a été généré");

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

          */







/**************************************/
----- Original Message ----- 
From: "Bastien DEBLAIS" <bd...@iftechnologies.net>
Newsgroups: gmane.text.xml.batik.user
Sent: Thursday, June 30, 2005 1:52 PM
Subject: Re: RE:help me please clipping svg (see it thomas)


> re Thomas
> i already send an message before with my code see it
> just to tell ma how to save the clipping in an another svg
>
>
> thanks
>
>
>
>
> ----- Original Message ----- 
> From: <wo...@free.fr>
> Newsgroups: gmane.text.xml.batik.user
> Sent: Thursday, June 30, 2005 12:50 PM
> Subject: RE:help me please clipping svg
>
>
> > ok but
> > for my job, the entreprise show a region ( "departement","comune" of a
> french
> > city)
> >
> > And i want to save an area of the map and save it into an another svg
> > document.(clipping)
> > give an example of a this because i think can't understand easily.
> >
> > thanks for all




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


Re: RE:help me please clipping svg (see it thomas)

Posted by Bastien DEBLAIS <bd...@iftechnologies.net>.
see at wolfyp64 before i do a code and i want to clip a rectangle
(0,0100,100) but i cant arrive how to lie the read svg with the cliping and
save the clipping into an another svg
----- Original Message ----- 
From: "Bastien DEBLAIS" <bd...@iftechnologies.net>
Newsgroups: gmane.text.xml.batik.user
Sent: Thursday, June 30, 2005 1:52 PM
Subject: Re: RE:help me please clipping svg (see it thomas)


> re Thomas
> i already send an message before with my code see it
> just to tell ma how to save the clipping in an another svg
>
>
> thanks
>
>
>
>
> ----- Original Message ----- 
> From: <wo...@free.fr>
> Newsgroups: gmane.text.xml.batik.user
> Sent: Thursday, June 30, 2005 12:50 PM
> Subject: RE:help me please clipping svg
>
>
> > ok but
> > for my job, the entreprise show a region ( "departement","comune" of a
> french
> > city)
> >
> > And i want to save an area of the map and save it into an another svg
> > document.(clipping)
> > give an example of a this because i think can't understand easily.
> >
> > thanks for all




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