20

How well has Scalable Vector Graphics worked for print?

I need to programmatically generate graphics for inclusion in print documents. It seems there are only two serious contenders for a target file format, EPS and SVG.

As a programmer, SVG looks easier to work with, but it doesn't appear to have been accepted by the graphics industry. There used to be projects to base print graphics on SVG (e.g. Adobe PDFXML), but none appear to be active now. Also, Adobe's tools seem to have ended a brief fling with SVG.

If I chose SVG as the deliverable format, what problems might there be, compared to the alternative(s)? I've heard complaints about SVG's handling of text, but I haven't found any detailed discussion. Another thing I suspect might be an issue is how cleanly SVG converts to PDF.

1
  • Should be libraries that can convert to PDF for you.
    – DA01
    Jun 10, 2013 at 5:49

5 Answers 5

8

Actually, for print EPS or PDF would be better. SVG is okay for web (which is what it was designed for) but often there are issues with RIPs when printing. Most designers who are supplied SVG files will open them in a vector app and re-save as either native files, eps or PDF. I would NEVER send an SVG file to a print provider.

5
  • But a PDF just should just embed the SVG onto a 'virtual paper', how does that solve the RIP issues?
    – jiggunjer
    Aug 24, 2017 at 3:54
  • 1
    @jiggunjer PDF uses an entirely different code structure than SVG. PDF is based upon postscript, svg is not. Saving as PDF does not "embed the svg as virtual paper". It's a different code base.
    – Scott
    Aug 24, 2017 at 3:57
  • I see, I thought the native svg was preserved similar to how a raster image is embedded. But now I understand there is a conversion to pdf paths. Is this lossless or can there be variations depending on the implementation of pdf converter? E.g. will Inkscape produce the same pdf for a given svg as ghostscript?
    – jiggunjer
    Aug 24, 2017 at 4:15
  • I can't comment on Inkscape. I can tell you that most Raster Image Processors (RIPs) used for commercial printing will likely choke on an SVG image. They won't understand the codebase. PDF is essentially a software RIP. So, generally, when you save something as a PDF, the code is rewritten/structured with output in mind the same way a hardware RIP would process images. Basically, an application capable of both SVG and PDF output must have internal conversion parameters to configure the output based upon format, and SVG is an entirely inappropriate format for commercial printing.
    – Scott
    Aug 24, 2017 at 4:51
  • Thanks. This got me thinking so I posted a related question: graphicdesign.stackexchange.com/q/97154/102588
    – jiggunjer
    Aug 24, 2017 at 4:54
3

I have used abcPDF to programmatically convert generated SVG to PDF for printing purposes. It's been about 4 years, but I can't imagine support for it in the library would've lessened.

3

Inkscape can convert SVG files to PDF and EPS via command line. Google "svg to eps command line". This would be a good solution for graphics intended for both web and print delivery.

Just beware that while this should work on Linux, Inkscape via command line on a Mac is somewhat broken (may have to compile Inkscape yourself or change file linkage inside the .app)

1

All industry (laser cutters, milling machines, etc.) relies on "doing physical work" with DXF, which is a Drawing Exchange Format, which can be converted to JSON AST (many libraries out there for this purpose) which can be exactly converted to SVG; so there is no possible reason preventing SVG to use for printing purposes.

One crucial attribute of SVG for this purpose is viewBox= which indicates the real world dimensions of the drawing. viewBox= should match with width= and height=, or you'll get cropped and scaled printing. You should provide viewBox= attribute on export and require it on import.

Still, you may encounter problems with SVG but this won't be SVG's fault: There are many buggy drivers/applications out there.

In my company, we use SVG for default drawing exchange format.

2
  • 1
    Use Step. While its true that my applications can read (some dialects of) DXF, its not true that my laser cutter, cnc mill or cnc lathe uses DXF. They in fact do not, the laser uses printer routines that are based on postscript due to need for rasteisation, which is closer to pdf than SVG. The cnc machines use G code. In either case DXF wont work for print due to the lack of right kind of primitives and CMS. But yeah you can convert svg to print but svg itself lacks features needed for commercial print. They would be easy to inject but not implemented after all SVG is like crippled pdf.
    – joojaa
    Oct 17, 2018 at 16:10
  • Thank you for opening the doors for a deeper discussion. I didn't mention middle steps to reduce complexity of the answer: G code or Postscript (or any end format) is produced by the company that holds the machine (laser cutter, printer, etc.) possibly by using the machine's proprietary software or by any converter that the machine supports its format. If a format (DXF, thus SVG in this case) is being used as a middle step, then it would mean that it is a suitable format for physical work. Would you mind mentioning what primitives are missing for SVG? (DXF doesn't have solid shapes, AFAIK)
    – ceremcem
    Oct 17, 2018 at 16:48
-1

If you need to convert the image to bitmap, make sure you select the right size before you convert the image because any resizing after the image is converted will result into loss of quality.

1
  • 3
    Can you explain why you think a change to bitmap could be useful? I would prefer a vector format.
    – Mensch
    Jun 9, 2013 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.