code: protected void writeSVG(Viewport vp, Writer out) throws IOException
      {
          //obtain the viewport bounds depending on whether we are clipping to viewport size or using the whole page
          int w = vp.getClippedContentBounds().width;
          int h = vp.getClippedContentBounds().height;
          
          SVGRenderer render = new SVGRenderer(w, h, out);
          vp.draw(render);
          render.close();
      }
docs: Renders the viewport using an SVGRenderer to the given output writer.
  @param vp
  @param out
  @throws IOException