Unable to copy paste from SVG generated by PDF2SVG

Post questions on how to use or achieve an effect in Inkscape.
jamadagni
Posts: 13
Joined: Tue Aug 09, 2011 12:38 am

Unable to copy paste from SVG generated by PDF2SVG

Postby jamadagni » Tue Aug 09, 2011 1:14 am

Hello. I've been using Inkscape on and off for a while. Right now I'm using Inkscape 0.48.1 on Kubuntu Natty.

I am working on an important project and need to copy-paste outlines (or what is it called) from one SVG to another. However, some (all?) SVGs which I created using PDF2SVG are giving me trouble. See the attached file test.svgz. On my system I am unable to copy the outlines in it to any other empty SVG. Please anyone try and say if you are able to copy it to another SVG.

What happens when I paste the glyphs to the new SVG is: when the source file (such as I have attached) shows in the status bar Group of 6 objects in root, when I paste it to the new empty document I see Group of 6 objects in layer Layer 1 in the status bar but no glyphs are actually visible. The curious thing is the selection (in the status bar, not in the page) goes away if I click outside the page and reappears when I do Ctrl+A.

The fill and stroke at the bottom left are showing unset but even if I go to Ctrl+Alt+F (Fill and Stroke panel) and select black fill and stroke, such a colour selection reflects in the bottom left but not in the actual drawing.

Anyhow, after copy-pasting thus, I saved the resultant apparently empty (but not empty) document and I get what I have attached here as drawing.svg. I open the drawing.svg in a text editor and I see lots of x:href entries but no outline data such as I can see by opening the test.svg in a text editor. It seems Inkscape is not copy-pasting the actual outlines but generating links.

I've tried this on Inkscape on Windows XP also and the same problem exists.

I have no problem in copy-pasting outlines from any other document other than these generated by PDF2SVG, so perhaps it is a problem with the SVGs generated by that software.

I don't know what the problem is and really need to copy these outlines to and from other SVGs -- can anyone please help?
Attachments
drawing.svg
The faulty file which is created by copy-pasting the test SVG and saving
(5.07 KiB) Downloaded 182 times
test.svgz
A sample file from which I'm unable to copy the outlines to another document in Inkscape
(29.17 KiB) Downloaded 174 times

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Unable to copty paste from SVG generated by PDF2SVG

Postby brynn » Tue Aug 09, 2011 3:29 am

Image
Welcome to InkscapeForum!

Someone else had a similar problem, not too long ago. In the end, the problem turned out to be that the program from which their original image came, had somehow clipped a layer during the conversion. It's not shown in the status bar, and someone who understands XML had to look in the XML Editor to figure it out. I'll look it up and post a link to that topic. You can follow that discussion, and perform those initial troubleshooting steps. And if you still can't fix it, someone else will have to look in the XML Editor (unless you're already familiar with it) because I'm not sure what to look for.

They had the exact same problem. It appears that the image was successfully pasted, because you do see the selection indicators, but don't see the objects. And I'm guessing you can't draw on the canvas either. Note that I haven't looked at your files yet, because I recognized your description as much like the other topic. So I will be back to edit in a link to the other topic, then I'll have a look at your files. I'm not sure I'll be able to find the problem, but I"ll try :D

EDIT
Weeelll :oops: it turns out the topic I was thinking about, that sounds like your same problem, actually wasn't. But I'm looking at your file now. Cross fingers :mrgreen:

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Unable to copy paste from SVG generated by PDF2SVG

Postby brynn » Tue Aug 09, 2011 4:23 am

Ok, well I don't know why it's happening, but I can confirm the problem you describe. Copying from the original and pasting into a new doc, seems successful, because Ctrl + A shows Group of 6, but I can't see it.

But I may have found a way to make it work. In the original, I ungrouped the 6 and found that they are 6 Groups. Ungroup again to find 16 Clones. I unlinked the clones and found 16 Groups. I ungrouped those, to finally find the original paths. And those paths, I can successully copy and paste in a new doc.

I don't know if there is some point along the way of all the ungrouping and unlinking, where the copy/paste will work. So you might not need to do all that before you can paste successfully. And I also don't know if this would even be feasible for your purposes?

If you need something more streamlined, I'm not familiar with the program you're using. So I can't suggest another solution. Maybe someone else will have some ideas about that?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Unable to copy paste from SVG generated by PDF2SVG

Postby ~suv » Tue Aug 09, 2011 4:51 am

Reposting since the topic was deleted while I was replying (and I didn't get the files):

Just a quick first answer without actually checking the files: from what I know about poppler-cairo based converters (such as PDF2SVG) and the resulting SVG files, any text contained in the PDF file is outlined (converted to paths) such that a definition for each letter is stored as path in the <defs> section of the SVG file, and then linked as clone inserted in the drawing to create the outlined text as seen on-canvas.

Inkscape - when pasting clones into a new document without the original(s) being part of the copied selection (e.g. because they are hidden away in the <defs> section) - does create orphaned clones (as the status line will tell you when <Tab>-selecting the invisible pasted objects in the new file).

You could consider unlinking the clones (selected paths for text) before copy&pasting them into a new Inkscape file to avoid the issue.

Before anyone asks and reports it again: it's a known bug that Inkscape does not automatically search for the originals and paste them together with the clones, or automatically unlinks the clones when pasting into a new document, already filed in the bug tracker.

Inkscape manual: Clones

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Unable to copy paste from SVG generated by PDF2SVG

Postby brynn » Tue Aug 09, 2011 7:03 am

Reposting since the topic was deleted while I was replying (and I didn't get the files):

I'm not sure what was happening, but the forum was down for a few minutes, a few minutes ago. But the topic is intact, and the files are there in the original message, as before.

But without having seen the files, I think you are stunningly correct, lol. There are indeed orphaned clones there (in the file where the objects were pasted)!

jamadagni
Posts: 13
Joined: Tue Aug 09, 2011 12:38 am

Re: Unable to copy paste from SVG generated by PDF2SVG

Postby jamadagni » Tue Aug 09, 2011 12:51 pm

Wow! Thanks people for all your help! Indeed by unlinking the clones I was able to copy paste the require text! You're truly great! :)

I've since then identified the bug in Launchpad and added my comments to it.


Return to “Help with using Inkscape”