package test;

import org.apache.batik.transcoder.*; // Using Batik 1.1.1
import org.apache.fop.svg.*;          // Using FOP 0.20.3

import java.io.*;

public class Test {

  public static void main(String[] args) throws IOException, TranscoderException {
    svg2pdf("test.svg", "test.pdf");
    System.exit(0);
  }

  private static void svg2pdf(String inFileName, String outFileName) throws IOException, TranscoderException {

    PDFTranscoder t = new PDFTranscoder();

    org.apache.fop.configuration.Configuration.put("strokeSVGText", Boolean.FALSE);

    FileInputStream fis = new FileInputStream(inFileName);
    FileOutputStream fos = new FileOutputStream(outFileName);

    TranscoderInput ti = new TranscoderInput(fis);
    TranscoderOutput to = new TranscoderOutput(fos);

    t.transcode(ti, to);

    fos.flush();
    fos.close();

  }

}
