HTML to PDF converter for Java and .NET

HOME   FEATURES   PRODUCTS   DOWNLOADS   BUY NOW!   SUPPORT
<< back

SVG vector graphics conversion support

Starting with version 3.8.5 PD4ML implements SVG parser/converter to PDF.

SVG images can be included to HTML code inline or referenced with <img> tag:

<h4>Referenced SVG</h4>

<img align=right border="1" src="chart.svg" width="300" 
style="background-color: tomato; page-break-inside: avoid">


<h4>Inline SVG</h4>

<svg width="200" height="150" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <g fill="none" stroke="black" stroke-width="4">
    <path stroke-dasharray="5,5" d="M5 20 l215 0" />
    <path fill="none" stroke-dasharray="10,10" d="M5 40 l215 0" />
    <path stroke-dasharray="20,10,5,5,5,10" d="M5 60 l215 0" />
  </g>
</svg>

Currently HTMLs with SVG graphics can be converted to PDF and to raster images. Support of HTML+SVG->RTF conversions is planned to be implemented later.

 

PD4ML supports the basic SVG concepts, allows to apply matrix transformations, control transparency, stroke and fill styles (where appliable).

 

List of SVG tags, supported by PD4ML

 
Tag Description Comments
<svg> Root element Currently PD4ML does not support a nesting of SVG tags.
<style> allows style sheets to be embedded directly within SVG content Some complex types of CSS selectors are not supported yet.
<text> defines a graphics element consisting of text  
<tspan> text and font properties and the current text position can be adjusted with absolute or relative coordinate values by including a <tspan> element Partially supported
<defs> graphical elements defined in a <defs> will not be directly rendered. You can use a <use> element to render those elements wherever you want on the viewport.  
<g> a container used to group objects  
<symbol> used to define graphical template objects which can be instantiated by a <use> element Partially supported
<use> duplicates nodes from within the SVG document  
<rect> basic SVG shape to create rectangles (also with rounded corners)  
<line> basic SVG shape to create a line connecting two points  
<circle> basic SVG shape to create circles based on a center point and a radius  
<ellipse> basic SVG shape to create ellipses based on a center coordinate, and both their x and y radius  
<polygon> defines a closed shape consisting of a set of connected straight line segments  
<polyline> basic SVG shape to create a series of straight lines connecting several points  
<path> generic element to define a shape. All the basic shape can be done with a path element  
<title> metadata Ignored
<desc> metadata Ignored
<metadata> metadata Ignored
<linearGradient> lets authors define linear gradients to fill or stroke graphical elements Gradients are partially supported by a conversion to a raster image only; cannot be converted to PDF yet.
<radialGradient> defines radial gradients to fill or stroke graphical elements Gradients are partially supported by a conversion to a raster image only; cannot be converted to PDF yet.
<stop> ramp of colors to use on a gradient Gradients are partially supported by a conversion to a raster image only; cannot be converted to PDF yet.
<pattern> used to fill or stroke an object using a pre-defined graphic object which can be replicated Ignored
<clipPath> defines a clipping path in <defs> section to be referenced from SVG elements or containers

 

Example

1.Source HTMLSource HTML (as text)PDF result
2.Source HTMLSource HTML (as text)PDF result

Copyright ©2004-17 zefer|org. All rights reserved. Bookmark and Share