Convert SVG to PDF

Question:

I would like to convert SVG to PDF

It seems like your product can convert PDF to SVG (with
pdftron.PDF.Convert.ToSvg()) but I also need to convert SVG to PDF.

I need the svg to perform in addition to the standard features the
following;

  1. Bi-directional support
  2. Masking with png transparency
  3. Text rotation (width bidi)
  4. Vertical alignment/baseline-shift

Answer:

You could use PDFNet SDK with HTML2PDF convert add-on as shown in
the following sample:
http://www.pdftron.com/pdfnet/samplecode.html#Html2Pdf

HTML2PDF includes built-in support for embedded SVG.

For example you can try converting http://apike.ca/prog_svg_webp to
PDF using pdftron.PDF.Html2Pdf

You could convert stand alone SVG urls by wrapping them in a small
HTML dummy page (e.g. a memory string).

For example:

`

`

Or

`

`

Question:

How do load the SVG file locally, if I want to use HTML2PDF::InsertFromHtmlString?
How does it load the SVG file?

Answer:

You can modify the html string to use the file:// protocol, like the following.

converter.InsertFromHtmlString("<html><head></head><body><object style='width:1098;height:450' data='file:///C:/work/files/test2.svg' type='image/svg+xml'></object></body></html>");