Can't find sheet total size inside Canvas

1 view
Skip to first unread message

MatteoM.

unread,
Jan 21, 2009, 3:04:46 AM1/21/09
to WPF Graphics Site group
The following SVG design have a sheet size of 1200x900 mm, it's
exported with Corel Draw X4:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/
Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Creator: CorelDRAW -->
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve"
width="1200mm" height="900mm" style="shape-
rendering:geometricPrecision; text-rendering:geometricPrecision; image-
rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
viewBox="0 0 1200 900"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<style type="text/css">
<![CDATA[
.str0 {stroke:#1F1A17;stroke-width:0.2}
.fil0 {fill:none}
]]>
</style>
</defs>
<g id="Livello_x0020_1">
<metadata id="CorelCorpID_0Corel-Layer"/>
<ellipse class="fil0 str0" cx="309.197" cy="575.907" rx="191.703"
ry="99.9129"/>
<rect class="fil0 str0" x="310.821" y="157.572" width="186.829"
height="173.832"/>
</g>
</svg>

i have readed it using the Ab2d.ReaderSvg but inside the
Ab2d.ReaderSvg canvas object, i can't find any place where is write
the total size of the sheet, in this case i don't find the number 1200
and 900... where i find it ?

Thanks
Matteo

Andrej Benedik

unread,
Jan 21, 2009, 9:26:12 AM1/21/09
to wpf-gr...@googlegroups.com
The current version of ReaderSvg does not use the size defined in svg element.

It computes the size of inner elements and assigns it to the main (first) Canvas element.

But I agree that it would be better to use the size in svg element. I have added it to my features list - I will try to implement it in the next release.

Currently I have some other this to do so I cannot say when the new version will be available. Probably in the in the first half of February.

Thank you for your notice.

Greetings,
Andrej

MatteoM.

unread,
Jan 23, 2009, 8:12:54 AM1/23/09
to WPF Graphics Site group
Thanks for answer, we wait your implementation.



On 21 Gen, 15:26, Andrej Benedik <abene...@gmail.com> wrote:
> The current version of ReaderSvg does not use the size defined in svg
> element.
>
> It computes the size of inner elements and assigns it to the main (first)
> Canvas element.
>
> But I agree that it would be better to use the size in svg element. I have
> added it to my features list - I will try to implement it in the next
> release.
>
> Currently I have some other this to do so I cannot say when the new version
> will be available. Probably in the in the first half of February.
>
> Thank you for your notice.
>
> Greetings,
> Andrej
>
> On Wed, Jan 21, 2009 at 9:04 AM, MatteoM. <melanmat...@gmail.com> wrote:
>
> > The following SVG design have a sheet size of 1200x900 mm, it's
> > exported with Corel Draw X4:
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/
> > Graphics/SVG/1.1/DTD/svg11.dtd<http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd>

Andrej Benedik

unread,
Feb 1, 2009, 8:54:45 AM2/1/09
to wpf-gr...@googlegroups.com
Matteo, if you are subscribed to my newsletter or rss feed, you have probably already noticed that the new version of ReaderSvg is available.
 
It now has AutoSize property, that is set to true by default. This means that the objects are sized to content. If the property is set to false, than the size of the defined in root svg element is taken as the main size - in your case 1200 x 900. In the first case it does not matter if you are drawing on the A4 or Letter area - you just want to get the objetcts. In the second case (AutoSize=false), the whole drawing area (A4, Letter, etc.) is shown and the objects are positioned on it.
 
The new property is also available in ViewerSvg - the it is controlled by AutoSize checkbox.
 
Andrej

Reply all
Reply to author
Forward
0 new messages