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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]