hi,

I have a SVG file which i am able to convert to PDF without a problem. However 
I would like to enable scripting in  the final PDF. Here is the SVG document:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns:svg="http://www.w3.org/2000/svg";
   xmlns="http://www.w3.org/2000/svg";
   version="1.1"
   width="436pt"
   height="327pt"
   viewBox="0 0 4360 3270"
   id="svg2">
  <path
 onclick="alert('mouse is clicked')" onmouseover="alert('mouse is over')" 
style="stroke:black; stroke-width:0.5;  fill:#AA5555; "
     d="M 2250 1590 L 1979 2333 A 791 791 0 0 0 2935 1986 z"
     id="path24" />
</svg>

_______________________________________
Here is the java code for converting the svg to pdf:


package svgtopdf;

// Java
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

//JAXP
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
import org.apache.batik.transcoder.Transcoder;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;


// FOP
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FormattingResults;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.apps.PageSequenceResults;
import org.apache.fop.svg.PDFTranscoder;

/**
 *
 * @author minhaszt
 */
public class Main {
    
    /** Creates a new instance of Main */
    public Main() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {

        svg2PDF();
    }
    private static void svg2PDF()
    {
       Transcoder transcoder = new PDFTranscoder();
        //Transcoder transcoder = new org.apache.fop.render.ps.PSTranscoder();
        
        //Setup input
       InputStream in=null;
       try{
            in = new java.io.FileInputStream(new File("embed.svg"));
            TranscoderInput input = new TranscoderInput(in);
            
            //Setup output
            OutputStream out = new java.io.FileOutputStream(new 
File("embed.pdf"));
            out = new java.io.BufferedOutputStream(out);
                TranscoderOutput output = new TranscoderOutput(out);
                
                //Do the transformation
                transcoder.transcode(input, output);

                out.close();


            in.close();
       }
       catch(Exception e)
       {
           e.printStackTrace();
       }
       finally
       {
           System.exit(0);
       }
    }
        }

________________________________________________

The result is the PDF document sans any scripting actions. Your assistance 
please?

Best Regards

Zafar

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]



-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to