6

I am using python to create a bunch of plots of my data and then Inkscape to layout individual plots and schematics in panels of a master figure. I also add some extra elements such as panel names and titles.

Every time I modify something in my Python code, I have to manually paste the svg/pdf plots into Inkscape. I have noticed that if I create the plots as raster images instead of vectors, I can insert a link in the Inkscape document, and have the figure panel update every time I regenerate the plots in python, which is phenomenal!

Currently I am using this approach with a high DPI, but ideally, I would like to insert a link to a svg/pdf file so that the entire figure is a vector instead of a high DPI, big sized raster. I have seen that it is possible to include pdfs (don't think svgs work) in this manner in Adobe Illustrator .ai-files, and I wonder if there is any way to do it in Inkscape as well?

When I insert image links, Inkscape creates a tag in the svg similar to this

<image
   sodipodi:absref="path/to/image.png"
   xlink:href="./image.png"
   y="14.014872"
   x="5.9285898"
   id="image12160"
   preserveAspectRatio="none"
   height="441.91879"
   width="466.55328" />

I can modify the path to point to an svg file, but Inkscape will automatically convert the svg to a low resolution raster. If I change the path to a pdf, I get an error. Is there anything I can modify in the svg-code to be able to link pdf/svg-files and have them render in Inkscape as vector files?

joelostblom
  • 43,590
  • 17
  • 150
  • 159
  • Maybe useful [related answer](http://stackoverflow.com/a/5451238/605276). – Juancho May 09 '16 at 13:40
  • Thanks @Juancho, I have tried using the `` tag, but inkscape converts the linked file to a low resolution bitmap image. I would like the svg/pdf at in vector form, so that I can save it in full resolution. – joelostblom May 09 '16 at 21:00
  • 1
    Latex with tikz would probably be better than a vector graphics software for this. – Joce May 10 '16 at 08:35
  • As explained [here](https://superuser.com/questions/255086/is-it-possible-to-embed-or-link-one-inkscape-svg-document-inside-another-one), the `` tag is rendered at a fixed resolution. The `` tag should do the job. – Marduk Feb 27 '18 at 13:31
  • @Marduk Thanks, I just tried with `` but it only allows to reference an element within an SVG file, so I can't find a way to include the entire figure (tried referencing the top level element, but it only rendered part of the figure). Do you have suggestions for how to include all elements of an SVG with `use` (without manually listing all of them)? – joelostblom Mar 02 '18 at 14:36
  • Rereading your original question, I believe you are better served by using Scribus instead of Inkscape. With it, you can insert links to PDF files, that are embedded when you export the document to PDF. It also has built-in LaTeX support. – Marduk Mar 13 '18 at 13:08
  • For anyone coming across this, it is now possible to link SVG files in inkscape https://graphicdesign.stackexchange.com/questions/70963/in-inkscape-can-i-link-to-a-pdf-svg-instead-of-embedding-its-content – joelostblom Jun 01 '21 at 15:52

0 Answers0