managed-commons / SvgNet

Fork of the SVG library for .NET that makes a GdiGraphics that "draws" on a SVG model
BSD 3-Clause "New" or "Revised" License
84 stars 37 forks source link

Does it support EMF image format? #32

Closed jaelys closed 3 years ago

jaelys commented 3 years ago

Is your feature request related to a problem? Please describe. When I use .emf image to svg, there is no response. Is it supported?

Describe the solution you'd like Is it possible to parse only emf binaryRecord without using Bitmap to avoid security considerations in some servers and do not support GDI+ wmf and emf

monoman commented 3 years ago

AFAIK nothing on metafiles are currently supported, both the old format (wmf) and emf.

SvgNet try to be a translator of GDI calls to structures in SVG, but some things simply don't map, or are too complex to map, supporting metafiles gets in the second case.

You can try to read the emf list of records and draw them in the SvgNet 'surface', but I things some (many) things may still fail.

That could be some code we would accept as a contribution towards adding such a feature.

xmojmr commented 3 years ago

Metafiles are supported in pen definition and used in SvgGraphics.DrawLines(Pen pen, PointF[] points).

See https://github.com/managed-commons/SvgNet/blob/v2.1.3/SvgNet/Graphics/SVGGraphics.cs#L654-L659

Parser of the metafile binary record is available in https://github.com/managed-commons/SvgNet/blob/v2.1.3/SvgNet/Graphics/MetafileParser.cs

monoman commented 3 years ago

Metafiles are supported in pen definition and used in SvgGraphics.DrawLines(Pen pen, PointF[] points).

See https://github.com/managed-commons/SvgNet/blob/v2.1.3/SvgNet/Graphics/SVGGraphics.cs#L654-L659

Parser of the metafile binary record is available in https://github.com/managed-commons/SvgNet/blob/v2.1.3/SvgNet/Graphics/MetafileParser.cs

Thanks for correcting me @xmojmr 💯