开发者

SVG_to_Flash: Adobe Illustrator 15.0.0 vs. 12.0.0, SVG Export Plug-In, width/height problem

开发者 https://www.devze.com 2023-03-14 10:45 出处:网络
I tried to figure this out for myself, but I\'m stuck. Overview:I have a flash based designer application that is picky about vector source from SVG uploads.I have about 1000 SVG \"templates\" that a

I tried to figure this out for myself, but I'm stuck.

Overview: I have a flash based designer application that is picky about vector source from SVG uploads. I have about 1000 SVG "templates" that are loaded in t开发者_JS百科o the flash based designer app and people can then build products on my site.

Problem: I don't know why this is causing my tool to break, but when I upload an SVG 1.0 that has been exported from Adobe Illustrator 15.0.0, SVG Export Plug-In it exports the svg width="###px" height="###px" tags differently and my finicky app won't take the file.

Specifically, Illustrator 12.0.0 seems to export width-"###" VS. 15.0.0 which adds 'px' so it outputs "###px". ### = Good, XXXpx = Bad (for my flash tool)

It doesn't cause an error (at least in the flash part I can see). The SVG just won't show up in the tool.

I have tried every possible SVG 1.0 export option variant using the 15.0.0 plugin with no luck getting it to export with the .

test4_good.svg works perfectly in my tool (width="###") test9_bad.svg breaks the tool (width="###px")

I'll paste the SVG source:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build        0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
 width="463px" height="462px" viewBox="0 0 463 462" enable-background="new 0 0 463 462" xml:space="preserve">

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
<svg  version="1.0" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
 width="463" height="462" viewBox="-0.96 0 463 462" enable-background="new -0.96 0 463 462" xml:space="preserve">
<defs>
</defs>
<path fill="#A59D9E" stroke="#000000" d="M452.375,231.13c0,122.212-99.053,221.285-221.239,221.285
c-122.186,0-221.238-99.073-221.238-221.285c0-122.213,99.052-221.285,221.238-221.285
C353.322,9.845,452.375,108.917,452.375,231.13z M231.136,69.65c-89.164,0-161.444,72.298-161.444,161.479
c0,89.181,72.281,161.476,161.444,161.476c89.165,0,161.442-72.295,161.442-161.476C392.578,141.949,320.301,69.65,231.136,69.65z"
/>
<path fill="#F8224E" stroke="#000000" d="M461.458,231c0,127.302-103.177,230.5-230.451,230.5
C103.731,461.5,0.556,358.302,0.556,231S103.731,0.5,231.007,0.5C358.281,0.5,461.458,103.698,461.458,231z M231.007,62.797
c-92.876,0-168.167,75.307-168.167,168.203c0,92.895,75.292,168.203,168.167,168.203c92.877,0,168.166-75.309,168.166-168.203
C399.173,138.104,323.884,62.797,231.007,62.797z"/>
<path fill="#A59D9E" stroke="#000000" d="M47.536,318.388l7.5-3.571c-7.012-14.581-12.256-30.17-15.477-46.486l27.477-0.037
c0,0-2.207-10.469-3.157-18.43c-0.918-7.684-0.993-18.184-0.998-18.906c0.004-0.722,0.08-11.223,0.998-18.906
c0.951-7.96,3.157-18.43,3.157-18.43l-27.724-0.038c3.115-16.366,8.27-32.007,15.196-46.648l-7.499-3.573
c-7.446,15.735-12.936,32.574-16.151,50.21l-27.274-0.037c0,0-1.297,6.575-2.335,20.073c-0.979,12.735-0.728,16.917-0.696,17.348
c-0.032,0.433-0.283,4.614,0.696,17.35c1.038,13.497,2.335,20.071,2.335,20.071l27.522-0.037
C34.43,285.927,40.002,302.717,47.536,318.388z"/>
<path fill="#A59D9E" stroke="#000000" d="M431.037,268.341l27.379,0.037c0,0,1.298-6.574,2.336-20.071
c0.979-12.735,0.729-16.917,0.696-17.35c0.032-0.432,0.283-4.613-0.696-17.348c-1.038-13.498-2.336-20.073-2.336-20.073
l-27.132,0.037c-3.214-17.636-8.705-34.475-16.15-50.209l-7.498,3.572c6.926,14.642,12.08,30.283,15.195,46.648l-27.867,0.038
c0,0,2.209,10.469,3.16,18.43c0.917,7.683,0.992,18.184,0.996,18.906c-0.004,0.723-0.079,11.223-0.996,18.906
c-0.951,7.961-3.16,18.43-3.16,18.43l27.619,0.037c-3.221,16.316-8.464,31.905-15.476,46.485l7.499,3.572
C422.14,302.717,427.713,285.927,431.037,268.341z"/>
<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#F8224E" stroke="#000000" points="16.377,230.592 31.8,206.367 
47.201,230.592 31.785,254.799 16.377,230.592 16.377,230.592 16.377,230.592 "/>
<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#F8224E" stroke="#000000" points="414.996,230.592 430.417,206.367 
445.817,230.592 430.403,254.799 414.996,230.592 414.996,230.592 414.996,230.592 "/>
</svg>

Thanks in advance for the help, Chase.


There's no functional difference between specifying a px unit and not specifying a unit at all. It's safe to strip the "px" part off.

0

精彩评论

暂无评论...
验证码 换一张
取 消