Drawing SVG in .NET/C#? [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'd like to generate an SVG file using C#. I already have code to draw them in PNG and EMF formats (using framework's standard class System.Drawing.Imaging.Metafile and ZedGraph). What could you recommend to do to adapt that code to SVG? Preferably I'd like to find some library (free or not) that would mimic System.Drawing.Graphics interface.

Check out the SVG framework in C# and an SVG-GDI+ bridge project.
From the above web page...
The SvgGdi bridge is a set of classes
that use SvgNet to translate between
SVG and GDI+. What this means is that
any code that uses GDI+ to draw
graphics can easily output SVG as
well, simply by plugging in the
SvgGraphics object. This object is
exactly the same as a regular .NET
Graphics object, but creates an SVG
tree. Even things like hatched fills
and line anchors are implemented.

We have made a public fork of the C# .NET SVG library on Github.
It is much improved over the one you find on Codeplex, please have a look and fork it as you like:
https://github.com/svg-net/SVG
Edit:
Just to let you know, as of January 2021:
While others seem dead for years, this is still active. But we could definitely use some help from other developers.

I used this one http://svg.codeplex.com/ and I am quite satisfied with it. Still has some bugs so you should have a look at the patches in http://svg.codeplex.com/SourceControl/PatchList.aspx.
When I discover mistakes I can solve I post them directly there. But it takes some time to be evaluated by the guys there. It's a better idea to have a look at the patches and apply them yourself.
The library is reasonably sufficient for most usual needs. for really fancy stuff, it needs to be improved thought...

As SVG is basically a XML document - you can implement "drawing" yourself. Check the specs at W3C SVG spec. I did it once to generate SVG signature images, all it took was a couple of hours and a firefox to test the generated image.
Of course this applies if you are generating image from user input or if you do not mind spending some time doing conversion from another vector image format.
P.S. you can create your own wrapper to mimic System.Drawing.Graphics, e.g. DrawLine() to append to the internal buffer and so on.

Related

Are there any open source software or c# libraries to extract piano chords from polyphonic music file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm new to this field, so kindly requesting your help. Are there any C# libraries that could extract piano chords from a polyphonic music file? I want to create a midi file using this piano chords. Is it possible? If you can point me to any open source software also fine.
Thanks in advance.
Shereen
This is not a trivial problem with a "the library you want is here" answer.
You are going to have to start getting familiar with what a Fast Fourier Transform is, and there are various libraries that implement those. FFTs can translate time-dimension data like a music file, to frequency-dimension data. You could use an FFT algorithm to convert the music file, look for frequency peaks, try to map them to notes and chords.
Here is a wikipedia entry showing what Fourier analysis is and examples of what it can be applied to.
Here is a SO answer for someone looking for a C# FFT library
Not easy at all - good luck.
EDIT: As recursive pointed out, you're not simply looking for a way to read/write midi files. I misunderstood. If you're trying to extract notes from a mp3/wav file, you won't have much luck finding any library that does that. It's not as simple, since you're working with essentially analog data instead of digital. I've seen some application that will at least show you a spectrograph of your audio, and if the audio is clean enough and only a single instrument, you can see what appears to be the notes. But you'd have to figure it all out manually. Izotope RX was the VST I was thinking of.
I had this problem maybe 5 or 6 years ago and eventually started writing my own (not as easy as it sounds). I got something working to read, but not write, but eventually ran out of time to work on the project.
I would try NAudio. I can't specifically vouch for it, as I haven't personally used it. However, the feature list says it has extensive support for reading and writing MIDI files.

Looking for a .NET Math Equation Editor and Solver Control [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am looking for a 3rd party custom control that can handle both editing and solving simple math equations (with image generation).
I know about LaTeX and using its syntax to generate images of math equations (i've used this project here that implements LaTeX: http://www.codeproject.com/KB/dotnet/Eq2Img.aspx), and i have found several projects that can take an equation as an inputted string, compile, parse, and solve the equation (here is one: http://www.codeproject.com/KB/recipes/EvaluationEngine.aspx).
However, i have yet to find anything that will allow you to both build an equation with an outputted preview image (like LaTeX does), and then allow you specify values for the variables in the equation, and solve the equation with the result outputted.
Does anyone know if any 3rd party control exists that can do both editing and solving of math equations? I am using C# .NET 4.0 so hopefully i can use the library/control in .NET.
Any help or links to something similar would be greatly appreciated.
Thanks,
Mark
You can use special .NET control - Math Expression Editor Light. It is symbolic math expr editor + computing enviroment.
see img
Solving math equations isn't really as straightforward as it seems, so you are not going to find a control that can both edit AND solve equations. Some 'equations' can't even be solved by a computer in the first place. It seems to me that you have already located two resources that are working for you, in a broad sense so you'd probably be better off just combining them yourself as you will spend more time looking for one that already exists.

How to convert PDF to WORD in c# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Does the anyone know a .Net component to convert PDF to Word or RTF programatically? I don't want to use OCR and Adobe dependent solutions.
I tried several libraries:
PDF Focus .NET: https://sautinsoft.com/products/pdf-focus/index.php
Aspose.PDF: https://products.aspose.com/pdf/net
Gembox: https://www.gemboxsoftware.com/document
Spire.PDF: https://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html
considered also using Word via COM automation to open and save to pdf programmatically.
Among all of them I liked PDF Focus .NET best of all, and I will explain why:
They try to keep the structure of the document EDITABLE, so that
when I will try to continue editing the text, the paragraph will be
smoothly prolonged. Other libraries are trying to do a
"minimalistic" approach by inserting absolute positioned shapes, so
that if you continue editing the text, it will overlap with the next
piece of text.
They do all their best to recognize tables, so
that tables in the output document will be REAL TABLES, but not a
collection of shapes and texts with absolute positioning (as
produced by other libraries).
A customer of ours is evaluating now different libraries, and I will recommend PDF Focus .NET first of all.
P.S. I AM NOT INVOLVED IN ANY KIND OF RELATIONSHIP WITH THIS SOFTWARE PRODUCER. As a former .NET developer I simply see a high quality components which really work fine.
Use PDF Focus.
Nice and easy.
EDIT: And also
How to convert DOC into other formats using C#
http://dotnetf1.blogspot.com/2008/07/convert-word-doc-into-pdf-using-c-code.html
You need something like GemBox.Document. It's a simple .NET component that enables you to manipulate and convert all kinds of document files.
You should have read this: C# and PDF. There are methods to convert, like beforementioned PDF Focus but be warned: it is buggy, and crashy process. PDF is not intended to be PC-readable.

DOT Language Parser [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Does anyone know of a DOT Language (or other GraphViz-ish format) Parser for .NET?
I have been experimenting with QuickGraph, but it seems to only support serialization, and not parsing from a stream/string/file.
Graphviz4Net core includes a DOT parser.
Yet another DOT parser:
Nuget package: https://www.nuget.org/packages/DotParser/
Sources: https://github.com/auduchinok/DotParser
Well you could use a XML-based format like GraphML which per se does not require its own parser, it also has xsd's specified , so its rather trivial to add to .NET
The SPGraphviz project handles graph descriptions in DOT:
SPGraphviz - create your own visualization graphs without programming in Sharepoint. Just define graph on DOT language in simple text file, upload it into document library and specify URL in SPGraphvizWebPart - it will make graphical representation of your graph
The documentation implies that the project uses a wrapper around the C language graphviz, and points to 2 such wrappers:
SPGraphvizWebPart uses Graphviz open source library for rendering graphs defined on DOT language. Many objects in real life can be presented as a graph mathematical abstraction. E.g. organization structure, portal hierarchy, version history of the files, etc. - all these can be displayed as a graph (number of nodes with relations between them). Using DOT language you can create textual definition of a graph (nodes, relations, visual effects like color, shape, etc) in simple text file and pass this file into Graphviz library. It will make graphical representation of the graph using selected layout and image type.
Graphviz - is library written on C. SPGraphviz uses managed wrapper for using functions from Graphviz library. There are several implementations of managed wrapper for Graphviz:
WinGraphviz by ood Tsen
Rendering an in-memory Graphviz image with C# by David Brown

Converting PDF into workable text using C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is there a library that has a class to extract the text from a pdf file in c#.net? I've tried a few but documentation is terrible, so I haven't been able to get it off the ground. Also if it provides a class to extract images that would be a plus. Any suggestions? Thx in advance.
Also I need to be able to implement it into an existing application.
Have you tried PDFKit.NET? It has reasonable docs and some good examples. It is designed for a server environment, so it is a little expensive.
EDIT Here is an open source library on SourceForge called iTextSharp. It is free for open source projects. I haven't used it, but it looks promising. Here is a tutorial for it that has lots of code examples.
There are a couple of ways you can go here -- a lot of it will depend on whether you want to retain the formattting (i.e., paragraphs and other layout elements) of the original PDF.
If you're considering commercial solutions, we do offer two products that might meet your requirements. One is EasyPDF SDK which has single shot ExtractText() and ExtractText2() calls that pull text out of your PDFs as plain text.
Note that the output from these calls is pretty simplistic and you will lose a lot of the original layout elements. They're nice for simple text extraction but might not be great if your PDF contains tabular data.
If you're dealing with tables, a nicer alternative could be to pull it out as rich text instead. We a have a tool called EasyConverter SDK geared for business documents which does just that using a single function call.
With EasyConverter SDK, the layout of your original PDF will be retained.
Both support C# so feel free to check out the eval versions at www.pdfonline.com if you're interested. I do work for the vendor so do take this suggestion as kind of a mother loving her own child :-) I've been browsing stackoverflow.com for code snippets for a long time, but have only recently started posting, so if you have any questions with either API just let me know and I can help. Cheers!
Docotic.Pdf library can extract text and images from PDF files.
You can extract text from whole document of from some pages only. The library can extract plain text and also text chunks with coordinates.
You can extracted images from PDFs (as JPEG and TIFF files).
Here is a couple of samples for your task:
Extract text from PDFs
Extract images from a PDF
Disclaimer: I work for Bit Miracle, vendor of the library.
we've used snowbound software at work for image conversion. it apparently supports text extraction too. however, it's not free.

Categories