Hi !

I try to use the PDFTranscoder shipped with the latest version of Batik (1.5 beta 5), but I always obtain a valid but blank PDF document (the dimension of the document is allright).

Here is the source code:
    DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
    String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
    Document document = impl.createDocument(svgNS, "svg", null);
    SVGGraphics2D g2d = new SVGGraphics2D(document);
   
    // ... draw some shapes ...
    File pdf = ...
   
    OutputStream out = new FileOutputStream(pdf);
    PDFTranscoder t = new PDFTranscoder();
    TranscoderInput input = new TranscoderInput(document);
    TranscoderOutput output = new TranscoderOutput(out);
    try {
        t.transcode(input, output);
    } catch (Exception ex) {
        throw new IOException(ex.getMessage());
    } finally {
        out.flush();
        out.close();
    }
==> No shape is visible in the resulting PDF file ! I thought I had to use a TranscodingHint, but I don't know how with PDF, and Batik & FOP documentation are not very explicit on SVG => PDF transcoding subject.
 
Where am I wrong ?
 
Hervé

Reply via email to