I have a c# appliation which has an SVG parser in it . When I pass the follwing svg document (SVG01) to the parser it throws an exception :
The input is not a valid Base-64 string as it contains a non-base 64
character, more than two padding characters, or an illegal character
among the padding characters.
My svg that is going to the used in the application is as follows
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg width="210mm" height="297mm"
xmlns="http://www.w3.org/2000/svg" dominant-baseline="hanging">
<image x="2.34mm" y="3.44mm" height="20mm" width="40mm" href="D:\linkedSvg.svg"/>
</svg>
The LinkedSvg.svg is as follows
<svg xmlns="http://www.w3.org/2000/svg" dominant-baseline="hanging" width="400" height="110">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
</svg>
Looks like in SVG href needs to have some base:64 encoding characters right ?
IS there any other way to Link 2 svgs together ?
Hi I have a xml file that contains
<?xml version="1.0" encoding="utf-8"?>
<resources>
<iconback img1="iconback" />
<iconmask img1="iconmask" />
<iconupon img1="iconupon" />
<scale factor="0.7" />
</resources>
How can I change and save the img="iconback" outer text and Scale factor="0.7?
Everything I try fails with
Cannot set a value on node type 'Element'
I have some SVG files stored in a database as a string. What would be the best way to display these images on a razor view template?
I was hoping to just display the string directly
something like
<div>
#Model.Icon
</div>
but when I do this quotation marks are placed around the content so the image doesnt display
example svg format is
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 127.4 72.2" style="enable-background:new 0 0 127.4 72.2;" xml:space="preserve">
<title>Artboard 2 copy 11</title>
<path d="M126.3,7v10.5c1.3,7.7,1.5,18.2,0.2,29.7c-0.9,8.5-2.6,16.8-5.1,24.9h-7l-4.7,0h-8.7c-1,0-1.8-1.4-1.8-3.1l0,0
c0-1.7,0.8-3.1,1.8-3.1h1.8c1.2-4.8,2.1-9.6,2.8-14.5h-1.9c-2.8-0.2-5.1-2.5-5.1-5.3l-0.1-11.8H87.1c-9.7,0-19.8-3.3-22.5-11.3h-7
c-0.6,0-1-0.5-1-1.1v-0.6H44.9v-3.6h-5.4c-1.2-2.6-3.3-3.1-7.1-3.7c-0.1,0,4.1,1.4,4,3.7h-6.1c-1.2-2.6-3.4-3.1-7.1-3.8
c-0.1,0,4.1,1.4,4,3.7h-6.1c-1.2-2.6-3.4-3.1-7.1-3.7c-0.1,0,4.1,1.4,4,3.7h-5.6c-1.2-2.6-3.4-3.1-7.1-3.7c-0.1,0,4.1,1.4,4,3.7H4.4
c-0.9-1.8-2.2-2.6-4.4-3.2v-1.3h44.9V9.6h11.7V9c0-0.6,0.4-1.1,1-1.1h6.5C67.3-3.2,126.3-1.8,126.3,7z M106.1,48.7
c0.1-0.5,0.1-0.9,0.2-1.4c0.5-4.5,0.8-8.8,0.8-12.9h-5.6l0.1,11.8c0,1.1,0.8,2.1,1.8,2.4c0.2,0,0.4,0.1,0.5,0.1H106.1z"/>
</svg>
you can use :
#Html.Raw(Model.Icon)
I want to create a splash screen to my Android program. I am using C# and Xamarin in Visual studio to write my app.
I have followed a Xamarin Tutorial on how to create splash screen, when building the app, it gave me this error:
Error retrieving parent for item: No resource found that matches the
given name (Theme.AppCompat.Light)
in my Style.xml.
Here is my Style.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme.Base" parent="Theme.AppCompat.Light">
</style>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Splash" parent ="Theme.AppCompat.Light">
<item name="android:windowBackground">#drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
I have searched all the internet for a solution to my problem but didn't worked. Please don't consider it as duplicate cause I have seen all the answers and they didn't fixed my problem.
I'm definitely missing something. I have an XML file that stores HTML snippets, as below:
<?xml version="1.0" encoding="utf-8"?>
<presentation>
<slide id="1" title="Test Slide 1">
<h1>This is test slide 1.</h1>
<p>Information on test slide.</p>
</slide>
<slide id="2" title="Test Slide 2">
<h2> This is test slide 2.</h2>
<p>Information on test slide.</p>
</slide>
<slide id="3" title="Test Slide 3">
<h3> This is test slide 3.</h3>
<p>Information on test slide.</p>
</slide>
</presentation>
I'm building a ASP.net form that allows me to edit the contents of the "slides" and then save my changes. In order to do that, first i find the appropriate slide by id. Then I remove all the contents of the slide with RemoveNodes(), and then attempt to write the new contents with WriteRaw(contents).
XDocument xmlDoc = XDocument.Load(filepath);
XElement slide = xmlDoc.Descendants("slide").First(el => el.Attribute("id").Value.Equals(id));
slide.RemoveNodes();
using (var writer = slide.CreateWriter())
{
// contents are retrieved from a TextBox
writer.WriteRaw(contents);
}
xmlDoc.Save(filepath);
The code runs without error. However, when I check the xml file, the < and > characters for the html tags have been converted to < and >.
...
<slide id="1" title="Test Slide 1"><h1>This is test slide 1.</h1>
<p>Information on test slide.</p>></slide>
...
I'm guessing that another object is escaping the characters in the background. SaveOptions.DisableFormatting doesn't change the behavior. Can anyone point me in the right direction?
Sorry, but XmlWriter.WriteRaw works on XmlWriters writing to a stream or file but not when populating objects in System.Xml or System.Xml.Linq.
Use slide.Add(XElement.Parse("<dummy>" + contents + "</dummy>").Nodes()) instead.