Hi there!
First time user, and all I can say is that I LOVE Inkscape! I didn't know making vector graphics could be so easy.
I am having trouble dealing with a very complicated figure that I am including in my thesis. It is of the back panel of a Labview program (see attachment). The original figure was generated by printing to PDF inside the Labview program, and then imported into Inkscape from the PDF.
Ideally, I would like the figure to be a vector (eps specifically); when I import the ~200kb PDF into Inkscape, it becomes a 13mb SVG. This is expected, since inkscape imports vectors from PDFs in such a way that sometimes they need optimizing. With normal figures this is no problem.. but with this guy, I don't even know where to start.
I tried messing with the import settings (replacing fonts, embedding, rough meshes) but it doesn't seem to change the size of the SVG. Exporting to EPS generally causes Inkscape to crash, even when done completely in the command prompt. I also tried combining objects and simplifying, but all this does is distort the figure.
Any thoughts? I am not sure of how to go about solving this (or if it's even possible, for that matter). I am using the latest version of inkscape.
Thanks!
IHateMayonnaise
Help importing/exporting an extremely complicated figure
-
- Posts: 2
- Joined: Thu Feb 07, 2013 8:08 am
Help importing/exporting an extremely complicated figure
- Attachments
-
- BP.pdf
- PDF of the file I am trying to deal with
- (179.26 KiB) Downloaded 281 times
Re: Help importing/exporting an extremely complicated figure

Welcome to InkscapeForum!
Wow, that is some impressive work. I'm not sure if I can solve the problem. But I can make some comments which might help lead you to a solution. First, I opened the PDF with Inkscape, and used the default settings. I've attached a screenshot of a very small area (zoomed in) where I disassembled a few different elements to see how they are made.
So it appears that you've used many TINY images as masks, in some areas. I was not aware that raster images could be used as a mask, in Inkscape. And I'm not sure if that was a result of the conversion(s) you've done with the file, or maybe something to do with how Inkscape opens a PDF. And the reason I'm not sure, is that normally I would expect to see imported raster images embedded. But these don't appear to be embedded, which I don't understand how that could happen. If they had been embedded, I would suggest drawing those elements with tiny squares instead. A lot of work, no doubt, but embedded images can severely bloat the file size. But since they don't appear to be embedded, perhaps this would not help, at least not as much as if they were embedded. OR, maybe they are still somehow embedded, even though the XML Editor does not identify them as embedded.
Maybe you could take just a couple of those elements into a new blank Inkscape file and save that file. Then in a 2nd new file, recreate the same elements with tiny squares. This would eliminate not only the need for the image/masks, but also for some of the clipping paths. Plus, it appears that for every element made with the tiny images, that there are 2 masked squares on top of each other (1 for black, 1 for white). So I would expect it to reduce the file size significantly, just by halving the number of masked squares. And perhaps more, depending on how those many tiny images are being handled. Anyway, after both files are saved, you can compare their sizes to get some kind of idea how much benefit it might be to draw those patterns instead of using the image/masks.
I don't know how much precision you need for this, but that pattern border is probably contributing the majority of the kb/mb's. If you could just use a simple path instead, perhaps in a gray color, that would probably help even more than drawing all the tiny square patterns. Oh! And in some situations, you'll be able to draw just one of those pattern borders, and clone it for those that are the same size. I'm not sure if it would help reduce the file size (more than drawing them all) but it will save some time.
I'll be interested to learn, if anyone can explain, how those images are showing up on my computer, without having been embedded. And now that I think about it, I wonder when you're trying to export the EPS, if Inkscape is trying to embed those images, and that's what's causing the crash??
Just on some further investigation, it looks like there might be places where you used clipping that might be unnecessary. It's hard to say, because a lot of the groups that are clipped are so large, I can't find the objects that require the clip. It seems like there may be objects included in a clipped group, which don't necessarily need clipping. Maybe it was just a convenient way to keep things together. That shouldn't be contributing to the file size though.....I don't think....unless the clipping wasn't necessary at all. For example, a group of 129 clipped objects. (and there are many that size, and even larger) Did they all need to be clipped? Or were they just conveniently caught in the selection?
And one more idea -- for drawing the pattern/borders from scratch, you would quickly go bonkers drawing or duplicating squares, and snapping. So you could create a custom pattern instead. Or another idea would be Tiled Clones! And again, create just one of each size that you need, and clone or duplicate, to make the rest.
PS - For the record, I tried Vacuum Defs. But only 2 defs removed, so that won't help much at all

Edit
Afterthought -- Beware of nested clones, which can bloat a file. Always clone from the same "parent" object. If you end up with "Clone of: Clone of: Clone of: etc." it might cause more problems than you already have. So the Tiled Clones dialog may be your friend here. Just remember to keep using the same parent object each time.
Last edited by brynn on Tue Feb 12, 2013 9:57 pm, edited 1 time in total.
Reason: belated afterthought
Reason: belated afterthought
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Help importing/exporting an extremely complicated figure
Redrawing this in Inkscape would give you a tiny file that would probably handle easily. Unfortunately there is really no way to 'get there from here' i.e. no simple way to convert those decorative borders without redrawing them using a pattern. i estimate about 4 hours work. (Depending on your chops).
Your mind is what you think it is.
Re: Help importing/exporting an extremely complicated figure
Hi.
After experimenting with the BP.pdf file Inkscape crashed frequently during "normal" operations, even on other files that worked OK before the "experiment".
Found fifteen thousand PNG files in the Inkscape directory - all named BP_xxxxx.PNG.
All files contained small bitmaps from the borders shown in brynn's post.
Must be "leftovers" after Inkscape crashed while trying to save to EPS format?
Inkscape kept on crashing after deleting the files, looking at details hinted at error in files in the "C:\Users\Ragnar\AppData\Local\Temp",
Have not encountered any more crashes after deleting all files in the temp folder.
RGDS
Ragnar
After experimenting with the BP.pdf file Inkscape crashed frequently during "normal" operations, even on other files that worked OK before the "experiment".
Found fifteen thousand PNG files in the Inkscape directory - all named BP_xxxxx.PNG.
All files contained small bitmaps from the borders shown in brynn's post.
Must be "leftovers" after Inkscape crashed while trying to save to EPS format?
Inkscape kept on crashing after deleting the files, looking at details hinted at error in files in the "C:\Users\Ragnar\AppData\Local\Temp",
Have not encountered any more crashes after deleting all files in the temp folder.
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: Help importing/exporting an extremely complicated figure
Wow, sorry about that issue Ragnar. I'm glad I didn't try to save the EPS myself! I'm not set up to be able to open EPS, so I didn't see any reason to try 
You said you think those files might have been added during the crash/auto-backup. I wonder if they needed to be saved for the EPS export. I still don't understand how they can be displayed without being embedded. It must be something to do with being a PDF??

You said you think those files might have been added during the crash/auto-backup. I wonder if they needed to be saved for the EPS export. I still don't understand how they can be displayed without being embedded. It must be something to do with being a PDF??
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Help importing/exporting an extremely complicated figure
Hi
for brynn;
Nothing to be sorry about - it all adds to my experience - which is a good thing!
Looks like the PDF file had a lot of identical images embedded,
I tried to use the pdftoeps program converting the pdf file and it left the same number of png files on the drive.
for Wes;
Still no conclusion on how to convert the pdf file to EPS, one workaround might be to export from Labview to EPS directly.
http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/customizing_graphs_and_charts/#Exporting_Images_of_Graphs_Charts_and_Tables
Good Luck
RGDS
Ragnar
for brynn;
Nothing to be sorry about - it all adds to my experience - which is a good thing!
Looks like the PDF file had a lot of identical images embedded,
I tried to use the pdftoeps program converting the pdf file and it left the same number of png files on the drive.
for Wes;
Still no conclusion on how to convert the pdf file to EPS, one workaround might be to export from Labview to EPS directly.
http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/customizing_graphs_and_charts/#Exporting_Images_of_Graphs_Charts_and_Tables
Good Luck
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
- flamingolady
- Posts: 687
- Joined: Wed Jun 10, 2009 1:40 pm
Re: Help importing/exporting an extremely complicated figure
I'm not an expert in opening files, but had a couple of thoughts, some similar to Brynn's. I was thinking to open the file in GIMP and cut it into 3 or 4 'parts' which become separate files. Then open each one in Inkscape, and since it would become rasterized, then you could use the Trace function of Inkscape to get it back.
I was also wondering if zipping the file would help at all, zip it then try re-opening in Inkscape.
Also, am wondering if you opened the file on a system (like at a large company where you or a friend might work) that has a server based network where it could handle the size?
good luck.
oh, note to Brynn - I was able to open the pdf file into Inkscape without it asking me to embed it either, interesting huh. hmm, couldn't it just be traced from the pdf that opens in Inkscape? or is it too big, I didn't try it.
I was also wondering if zipping the file would help at all, zip it then try re-opening in Inkscape.
Also, am wondering if you opened the file on a system (like at a large company where you or a friend might work) that has a server based network where it could handle the size?
good luck.
oh, note to Brynn - I was able to open the pdf file into Inkscape without it asking me to embed it either, interesting huh. hmm, couldn't it just be traced from the pdf that opens in Inkscape? or is it too big, I didn't try it.
-
- Posts: 2
- Joined: Thu Feb 07, 2013 8:08 am
Re: Help importing/exporting an extremely complicated figure
Wow, thank you everyone for such thoughtful, thorough replies! I will go through these today -- hopefully one of the (many) suggested solutions will resolve this issue. I will report back with results. Thanks again so much!!
Cheers,
IHateMayonnaise
Cheers,
IHateMayonnaise