This project is read-only.

Strange results

Mar 18, 2011 at 8:30 PM

I'm trying to save a svg doc to an image. I get abou 2% of the images (first 2 squares of 35 squares) no text tspan or text values make it through.

In public static SvgDocument Open(Stream stream, Dictionary<string, string> entities) I do see that every node is looped over.

My code is

 

SvgDocument sampleDoc = SvgDocument.Open(stream);
sampleDoc.Draw().Save("someFile.jpg");

 

The svg doc looks like (works fine in firefox and inkscape):

<svg version='1.0' ><g ><rect id='rectMonthHeader' style='fill: rgb(119, 153, 0); stroke: rgb(0, 255, 0);' height='100px' width='1440' x='0' y='0' ry='8' ></rect><rect style='fill: rgb(194, 194, 163); stroke: rgb(0, 15, 240);' height='100' width='205' x='0' y='100' date='Sun Feb 27 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='4' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='4' y='136.8' fixY='0.8' >27</tspan></text><rect style='fill: rgb(194, 194, 163); stroke: rgb(0, 15, 240);' height='100' width='205' x='205' y='100' date='Mon Feb 28 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='209' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='209' y='136.8' fixY='0.8' >28</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='410' y='100' date='Tue Mar 01 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='414' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='414' y='136.8' fixY='0.8' >1</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='615' y='100' date='Wed Mar 02 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='619' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='619' y='136.8' fixY='0.8' >2</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='820' y='100' date='Thu Mar 03 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='824' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='824' y='136.8' fixY='0.8' >3</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='1025' y='100' date='Fri Mar 04 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='1029' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1029' y='136.8' fixY='0.8' >4</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='1230' y='100' date='Sat Mar 05 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='1234' y='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1234' y='136.8' fixY='0.8' >5</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='0' y='200' date='Sun Mar 06 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='4' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='4' y='236.8' fixY='0.8' >6</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='205' y='200' date='Mon Mar 07 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='209' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='209' y='236.8' fixY='0.8' >7</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='410' y='200' date='Tue Mar 08 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='414' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='414' y='236.8' fixY='0.8' >8</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='615' y='200' date='Wed Mar 09 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='619' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='619' y='236.8' fixY='0.8' >9</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='820' y='200' date='Thu Mar 10 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='824' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='824' y='236.8' fixY='0.8' >10</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='1025' y='200' date='Fri Mar 11 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='1029' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1029' y='236.8' fixY='0.8' >11</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='1230' y='200' date='Sat Mar 12 2011 12:26:29 GMT-0800 (Pacific Standard Time)' class='ui-droppable' ></rect><text x='1234' y='200' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1234' y='236.8' fixY='0.8' >12</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='0' y='300' date='Sun Mar 13 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='4' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='4' y='336.8' fixY='0.8' >13</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='205' y='300' date='Mon Mar 14 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='209' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='209' y='336.8' fixY='0.8' >14</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='410' y='300' date='Tue Mar 15 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='414' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='414' y='336.8' fixY='0.8' >15</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='615' y='300' date='Wed Mar 16 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='619' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='619' y='336.8' fixY='0.8' >16</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='820' y='300' date='Thu Mar 17 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='824' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='824' y='336.8' fixY='0.8' >17</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='1025' y='300' date='Fri Mar 18 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='1029' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1029' y='336.8' fixY='0.8' >18</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='1230' y='300' date='Sat Mar 19 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='1234' y='300' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1234' y='336.8' fixY='0.8' >19</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='0' y='400' date='Sun Mar 20 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='4' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='4' y='436.8' fixY='0.8' >20</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='205' y='400' date='Mon Mar 21 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='209' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='209' y='436.8' fixY='0.8' >21</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='410' y='400' date='Tue Mar 22 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='414' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='414' y='436.8' fixY='0.8' >22</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='615' y='400' date='Wed Mar 23 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='619' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='619' y='436.8' fixY='0.8' >23</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='820' y='400' date='Thu Mar 24 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='824' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='824' y='436.8' fixY='0.8' >24</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='1025' y='400' date='Fri Mar 25 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='1029' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1029' y='436.8' fixY='0.8' >25</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='1230' y='400' date='Sat Mar 26 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='1234' y='400' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1234' y='436.8' fixY='0.8' >26</tspan></text><rect style='fill: rgb(221, 170, 0); stroke: rgb(0, 15, 240);' height='100' width='205' x='0' y='500' date='Sun Mar 27 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='4' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='4' y='536.8' fixY='0.8' >27</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='205' y='500' date='Mon Mar 28 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='209' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='209' y='536.8' fixY='0.8' >28</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='410' y='500' date='Tue Mar 29 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='414' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='414' y='536.8' fixY='0.8' >29</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='615' y='500' date='Wed Mar 30 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='619' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='619' y='536.8' fixY='0.8' >30</tspan></text><rect style='fill: rgb(255, 240, 184); stroke: rgb(0, 15, 240);' height='100' width='205' x='820' y='500' date='Thu Mar 31 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='824' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='824' y='536.8' fixY='0.8' >31</tspan></text><rect style='fill: rgb(194, 194, 163); stroke: rgb(0, 15, 240);' height='100' width='205' x='1025' y='500' date='Fri Apr 01 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='1029' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1029' y='536.8' fixY='0.8' >1</tspan></text><rect style='fill: rgb(194, 194, 163); stroke: rgb(0, 15, 240);' height='100' width='205' x='1230' y='500' date='Sat Apr 02 2011 12:26:29 GMT-0700 (Pacific Daylight Time)' class='ui-droppable' ></rect><text x='1234' y='500' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan x='1234' y='536.8' fixY='0.8' >2</tspan></text><text id='textMonthHeader' x='720' y='50' width='400' height='100' style='fill: rgb(0, 0, 170); stroke: none; font-size: 40px; font-style: normal; font-weight: normal; fill-opacity: 1; font-family: Bitstream Vera Sans;' ><tspan id='textMonth' x='613.5' y='63.8' fixY='0.3' fixX='-0.5' >Month Name</tspan></text><rect style='stroke: rgb(221, 170, 0); fill: rgb(0, 0, 255); position: relative;' height='25px' width='165.71428571428575px' x='0' y='0' rx='10' ry='10' class='ui-draggable' ></rect></g></svg>

Mar 18, 2011 at 9:38 PM

The problem has to do with the height.

On the svg node if I add a height="correct size" then I get the entire image + a lot of blank space.

Either this tool doesn't calculate the resulting size of the SVG file correctly or I am doing something wrong

 

Also it does not seem to handle <text <tspan or textNodes at all

Mar 26, 2011 at 1:54 AM

I never did get tspan to work however everything else works nicely.

It's perfect for what I'm doing except that the .Write methods are not written.

Are there any plans on doing that?