xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruben Malchow <ru...@khm.de>
Subject pdf & gradients ...
Date Wed, 06 Sep 2006 15:02:50 GMT


hello list,

i am currently having a problem with gradients in a pdf export. if i 
export it using PDFTranscoder, all gradients are pure black (try the 
example "3D.svg"). when saved as jpeg, everything is fine.

is this a bug? i didnt find a bug report, so i reckon it is an unknown 
bug (hardly believable) or i am doing something wrong ....

.rm


--------------------------------------------------------

the code i am using is this:

     public static SVGDocument loadSvg(String is) {
         String 	xmlParser =
		XMLResourceDescriptor.getXMLParserClassName();

         SAXSVGDocumentFactory 	df =
		new SAXSVGDocumentFactory(xmlParser);

         SVGDocument doc = null;
         try {
         	File f=new File(is);
		String fileUrl=f.toURL().toString();
         	doc = (SVGDocument)df.createDocument(fileURL);
		return doc;

         } catch (IOException ioe) {
             ioe.printStackTrace();
             System.exit(0);
         }
	return null;
     }

     public static void savePDF(SVGDocument doc, File f) {
	System.err.println("saving pdf ... ");
     	try {
		OutputStream os=new FileOutputStream(f);
		PDFTranscoder t = new PDFTranscoder();
		TranscoderInput input = new TranscoderInput(doc);
		TranscoderOutput output = new TranscoderOutput(os);
		t.transcode(input, output);
     	} catch (Exception e) {
     		e.printStackTrace();
	}
     }

     public static void main(String[] args) {
	SVGDocument in=loadSvg(args[0]);
	File out= new File(args[0]+".pdf");
	savePDF(in,out);
     }

	

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


Mime
View raw message