0

I have created a complex SVG file with scientific data: https://svgshare.com/s/TcX . The individual plots were generated as PDFs by the original data analysis software (FlowJo), I imported them separately and made some minor modifications (resizing, adjusting alignment etc.).

When I export the figure from Inkscape as a PDF, the small dots are lost and some plots get an unwanted black background: https://pdfhost.io/v/HAndEZSsd_nucleigatingpdf.pdf

Is there a way to export the figure without it getting changed, or can I modify some objects so that they are not problematic to export? I would ideally like to export the figure as PDF, as I want to import it into a Latex document, but other vector formats might also be ok.

If I export als PNG the figure comes out correctly (but I need a vector format).

Update: If I ungroup all the objects and export as PDF, the dots appear but are blurred: https://pdfhost.io/v/gIOby7gcM_nucleigatingtestpdf.pdf

Solution: I solved the problem by going to the original file exported from FlowJo, removing all groups and masks, and copying the embedded raster images into my layout. Then the PDF export worked correctly.

11
  • How did you create these diagrams? They contain raster images, so I'm guessing not in Inkscape. Unfortunately it's difficult to say what the problem is for sure. There are however a bazillion clipping paths, and multiple nested groups. I'm guessing that those are probably the culprit, and were generated by the software you used to create the diagram, not Inkscape. See screenshot here showing 5 nested groups for the raster image alone. This is totally excessive. Perhaps try deep ungrouping, and I'm not really sure what all those clipping masks are for either.
    – Billy Kerr
    Jan 31 at 12:12
  • Thank you! I'm a bit new to Inkscape, so I'm not quite sure how to do what you suggest. I can select the whole image and ungroup as far as possible. How do I remove clipping masks (I wasn't aware there were any...)?
    – Nereus
    Jan 31 at 12:17
  • You haven't answer my question. What was software was used to create this? As for deep ungrouping, it's under Extensions > Arrange > Deep ungroup. Clipping masks can be released using Object > Clip > Release. I've no idea if these will work for you though, so I certainly can't guarantee it. Not all SVGs are compatible with Inkscape or saving as PDF.
    – Billy Kerr
    Jan 31 at 12:26
  • The plots were created in FlowJo v10 (flowjo.com) and exported from the software as PDFs (I've added this info to the post).
    – Nereus
    Jan 31 at 12:28
  • Hmm . . . I thought you said you exported as SVG so you could open in Inkscape, then export from Inkscape as PDF. So, what's wrong with the PDF you exported from FlowJo. Is it not working?
    – Billy Kerr
    Jan 31 at 12:37
3

The SVG has several problems, although "several" might be a slight underestimate! It has a bazillion clipping paths and excessive nested groups generated by your plotting software. I'd suggest these are just totally confusing poor old Inkscape.

For example, one of the raster images has 5 levels of nested groups. This is totally excessive.

enter image description here

Possible fixes

  • To do a deep ungroup: Extensions > Arrange > Deep ungroup
  • To release clipping paths: Object > Clip > Release

However, this might not be enough to fix the problem. You may need to change your workflow. Importing PDFs into Inkscape, then trying to Export as PDF might just be too problematic with too many potential pitfalls, which could be virtually impossible to pin down and resolve.

What I suggest is instead of doing this, you export the diagrams from your plotting software as raster images, then add the labels and text in Inkscape.

Another possibility is not to use Inkscape at all. Scribus is open source page layout software which can import PDFs, edit and/or rearrange the layout, and output as PDF. This would dispense with the need to use SVG as the go-between.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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