Printing Schematic To SVG -- Solved?

There are a lot of complaints about QSpice not directly supporting SVG. If I understand correctly PDF has SVG internally… (Edit: Maybe not SVG but definitely vector graphics.)

I used the built-in Windows print-to-PDF driver. When opened in Inkscape, the various “objects” can be selected and their properties can be adjusted. Sample below (strokes, sizes, etc., randomly changed):

Does this solve anyone’s problems?

–robert

2 Likes

Thanks for this post !!

My view of the situation is still the same as when I posted 6 months ago about this issue.

QSPICE still only supports exporting Schematic and Waveform by…

  • File → Print → Microsoft Print to PDF → PDF file
  • Right Click → Copy Bitmap to Clipboard

I still believe QSPICE needs a simple one-step method to export the schematic to each of the following file types without being forced to use 3rd party software to accomplish the task.

  • Export Schematic to SVG vector file as Color.
  • Export Schematic to SVG vector file as Monochrome (Black on White).
  • Export Schematic to PNG bitmap file as Color.
  • Export Schematic to PNG bitmap file as Monochrome (Black on White).
2 Likes

Well, for those who absolutely must generate *.svg directly, there’s this open source tool: ClawPDF. The install creates a printer driver (clawPDF) that can be configured to output a SVG file. I tried it and it works fine.

Of course, for those on a corporate network, you’ll probably need the techs to install it. Which, of course, they won’t want to do. Maybe you can convince them to buy/install a commercial product that does the same thing. Which, of course, they won’t want to do.

But for the rest of us, it’s an option.

–robert

1 Like

And here’s option #3 for those that could use Postscript files instead of SVG for vector graphics: Use the Microsoft PS printer driver. It’s not installed/enabled by default so you’ll need to set it up in Printer Settings.

–robert

Microsoft Print to PDF (*.pdf) and Microsoft XPS Document Writer (*.oxps) printer drivers work reasonably well. However, Adobe PDF (*.pdf) printer driver (if Acrobat, etc., is installed) in general provides superior quality because it turns the arcs and coils approximated by polylines in QSPICE into Bézier curves. Of course this will only work as long as QSPICE won’t switch to print bitmaps only…

As I understand it, the XPS stuff is vector graphics so, yeah, should work. But I’ve not found any programs that support opening/importing the files other than the Microsoft-supplied viewer. What are you using?

Not sure what that means. Could you elaborate?

–robert

Also only XPS Viewer. But the XML format is sometimes convenient to extract exact coordinates.

Since, currently, all drawing is implemented twice, once for the screen and once for printing, there are (or were) apparently considerations to consolidate the code (for more consistency and possible acceleration by the GPU) and generate bitmaps only.

Anyways, after that response I got bored with QSPICE. Maybe the workaround would be to convert the input files ourselves to vector formats (the values calculated by the simulation would possibly be missing then).

For those still motivated, it looks like (besides of the obvious GDI objects like ellipse and arc) the coil and arc3p objects are constructed as follows, where the coils could be reasonably well approximated with elliptical arcs (A in SVG paths) and the arc3ps would possibly need numerically fitted Bézier curves (C in SVG paths):

arc3p can be viewed as a degenerate Archimedean/arithmetic spiral (or mosquito coil or [toilet] paper [sc]roll) with turn < 1, and as an arc with constant radius if both arc points have the same distance to the center. coil is an orthographic projection of a helix with k = 2 instead of the usual √3. For zigzag, n = int(¾ y/x + 1) and d = y / 4n.

KiCad 8 (due within a month or so) will be able to import LTspice files, so it should probably be possible to adapt it to QSPICE files with these additional graphics primitives.

Thanks RDunn for the tip about ClawPDF printer driver. It does allow QSPICE to print to SVG, which I can view a schematic on 3 different web browsers, and Inkscape likes it too.

I still believe SVG exporting should be built-in to QSPICE to make it as easy as possible for all users.

3 Likes

this is the best way