code: @SuppressWarnings({"WeakerAccess", "unused"})
     public void  renderToCanvas(Canvas canvas, RectF viewPort)
     {
        RenderOptions  renderOptions = new RenderOptions();
  
        if (viewPort != null) {
           renderOptions.viewPort(viewPort.left, viewPort.top, viewPort.width(), viewPort.height());
        } else {
           renderOptions.viewPort(0f, 0f, (float) canvas.getWidth(), (float) canvas.getHeight());
        }
  
        SVGAndroidRenderer  renderer = new SVGAndroidRenderer(canvas, this.renderDPI);
  
        renderer.renderDocument(this, renderOptions);
     }
docs: Renders this SVG document to a Canvas object.
  
  @param canvas the canvas to which the document should be rendered.
  @param viewPort the bounds of the area on the canvas you want the SVG rendered, or null for the whole canvas.