Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Hopefully this is me doing something wrong, but if my suspicions are a correct and it's a bug I'll submit a bug report.

I have an svg file (originally drawn by matplotlib, but I suspect that's not relevant). I scaled some paths in height only (and clipped them), now when I load the pdf in evince, gimp or gv *-- but not inkscape -- the stroke width is scaled in height as well, though I did not have the scale stroke when scaling affect selected.

Opening the pdf in inkscape and exporting as .png:

enter image description here

opening the same pdf in the Gimp:

enter image description here

some unscaled paths are seen on the left as well.

Is there anything I can do about this? I really need to work on the svg rather than going back to the data processing and modifying the code in matplotlib, and I need to scale by an integer by typing, not by dragging.

Edit: *I've just install foxit on my windows vm - the same as everything except inkscape

Edit2: Here's a minimal(ish) svg that shows the problem (really, no SVG upload?):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   width="86.874992"
   height="33.008114"
   viewBox="0 0 69.499992 26.406493"
   id="svg2">
  <metadata
     id="metadata1778">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <defs
     id="defs4"
     style="stroke-linecap:square;stroke-linejoin:round">
    <style
       type="text/css"
       id="style6" />
  </defs>
  <path
     d="m 73.4966,215.574 2.6784,0.104 5.9148,0.341 11.9412,-0.054 21.874,-0.079 9.597,-0.184 4.911,-0.321 2.901,-0.402 4.018,-0.785 0.446,-0.378 0.447,-0.689 0.446,-1.086 0.558,-2.019 0.67,-3.471 0.781,-5.406 1.227,-10.454"
     transform="translate(-72.968769,-190.125)"
     clip-path="url(#p19969a3f5c)"
     id="path722"
     style="fill:#ff0000;stroke:#0000ff;stroke-width:1;stroke-linecap:square;stroke-linejoin:round" />
  <defs
     id="defs1765">
    <clipPath
       id="p19969a3f5c">
      <rect
         width="446.39999"
         height="101.64706"
         x="72"
         y="165.17647"
         id="rect1774"
         style="stroke-linecap:square;stroke-linejoin:round" />
    </clipPath>
  </defs>
</svg>

*To demonstrate, stretch in height only than save as pdf and open in your viewer of choice (except inkscape).

Note that I've added a fill to prove that it's just a path and not an object being scaled

More new info - if I remove the clip, it scales as it should*

share|improve this question
    
At the moment the best option looks like taking each of the <path>s into libreoffice, recalculating the coordinates and putting them back! –  Chris H Jan 15 at 11:15
    
Are you sure, that your line actually is the stroke of a path and not the inside of a line-shaped polygon (i.e., what you get if you apply Stroke to Path to a normal path)? Alternatively, the paths in question look scaled in one direction – maybe this helps to find the source of the issue. –  Wrzlprmft Jan 16 at 11:03
    
Also, could you reduce your problem file to a minimal example and post it? –  Wrzlprmft Jan 16 at 11:24
    
@Wrzlprmft, I'll try - not sure if I have a copy of the file with me today. I suppose there's a chance matplotlib did something daft, but I'm pretty certain that it didn't - there's no fill colour only stroke, and the "filled" region is wider than twice the stroke width. –  Chris H Jan 16 at 11:45

1 Answer 1

In the end I did what I said in my comment, but I still think there must be a real solution. I only had 4 paths in one file to deal with (I have seen this before actually, but the aspect ratio of the scale wasn't as bad and I didn't have time to worry about it).

This is what I did:

  • Note the object IDs of the paths I wanted to edit
  • open the .svg in jEdit
  • Find each path in turn
  • work on the d attribute
  • replace " " with "\n"
  • copy into libreoffice calc
  • multiply the 2nd column, except the first 2 rows (only the 2nd of which was numeric) and the last row by 20 (my scaling factor)
  • back to jEdit
  • replace "\t" with "," (except after the "m", when it was just deleted
  • replace "\n" with " "
  • paste over the original path
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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