Aspose slide include svg into ppt slide - aspose

Does Aspose slide include svg into ppt slide? Is there way using slide api to do this? Any snippet would be good for reference.

I suggest you to please try using following sample code on your end using latest Aspose.slides for .NET 17.12.
string dataDir = RunExamples.GetDataDir_PresentationProperties();
using (var pres = new Presentation())
{
var svgContent = File.ReadAllText(svgPath);
var emfImage = p.Images.AddFromSvg(svgContent);
pres.Slides[0].Shapes.AddPictureFrame(ShapeType.Rectangle, 0, 0, emfImage.Width, emfImage.Height, emfImage);
pres.Save(outPptxPath, SaveFormat.Pptx);
}

I have observed your requirements and like to share that feature of adding SVG inside slide has been included in MS PowerPoint 2016. I regret to share that at present the requested support is unavailable in Aspose.Slides and an issue with ID SLIDESNET-39110 has been added to provide the requested support. This thread has been linked with the issue so that we may share notification with you once support will be available.
I am working as Support developer/ Evangelist at Aspose.
Many Thanks,

Related

How to make an Image Hyperlinked using Aspose.Words DOM approach?

I am trying to create a Word document using Aspose.Words for .NET using the DOM approach. How would I make an image hyperlinked?
Thanks,
Vijay
You can use Shape.Href property to set the URL.
Aspose.Words.Drawing.Shape shape = createOrFindShape();
if (shape.HasImage)
{
// Set hyperlink using Shape.Href
shape.HRef = "http://www.google.com";
}
I work with Aspose as Developer Evangelist.

Sitecore: Detect user in Page Editor mode

Can I know how to detect user is in page editor mode using code?
This is because, I have a component, when user browses from page editor, it will search in master_index folder instead of web_index folder.
Please check with : if (Sitecore.Context.PageMode.IsPageEditorEditing)
also is working on Sitecore 6.6, it not depends on Sitecore 7.
Please check also this Sitecore blog post by Martina Welander.
To check if is normal page use: if (Sitecore.Context.PageMode.IsNormal)
To check if is preview mode use: if (Sitecore.Context.PageMode.IsPreview)
Also are others PageMode:
IsPageEditorClassic
IsPageEditorDesigning
IsPageEditorEditing
IsPageEditorNavigating, etc
If you are curious you can check with Reflector or dotPeek this class: Sitecore.Context.PageMode from Sitecore.Kernel assembly.
Rather than checking the page mode, I think you just want to piggyback on the context database name -
var indexName = Sitecore.Context.Database.Name + "_index";
I am using this syntax in view to add a class for JS detection, same code can be used for back-end detection with bit modification:
<html class="#(Sitecore.Context.PageMode.IsPageEditor ? "inexpeditor" : "notexpeditor")">

Change image for Map aonnation view in rubymotion

I want to change UIAnnotationView image on mapkit in rubymotion language.
Any one know this, kindly help me.
How about a complete working example? I just tested it :)
A budy and I converted a LOT of iOS code from the iOS Cookbook to RubyMotion
There's a whole chapter on Maps, but the one that looks to answer your question best is this:
https://github.com/IconoclastLabs/rubymotion_cookbook/tree/master/ch_6/06_custompins
It's just like colored pins, but your main difference will be this
pinImage = UIImage.imageNamed("ilpin.png")
annotationView.image = pinImage
Goodluck! - Gant from Iconoclast Labs
I think you mean, an MKAnnotationView? If so, you just need to set the image property to a new UIImage. See this Gist:
https://gist.github.com/3049611
Based on the RubyMotionSamples Beer project - https://github.com/HipByte/RubyMotionSamples/blob/master/Beers/app/beer_map_controller.rb
I have added a new image file called 'signpost.png' under 'resources', and altered the code from using a pin to using a straight up annotation, with the new custom image.
The following code works fine to change the UIAnnotationView's image
view = MKAnnotationView.alloc.initWithAnnotation(annotation, reuseIdentifier:ViewIdentifier)
view.image = UIImage.imageNamed("ptr.jpg")
view.canShowCallout = true
I have saved the image ptr.jpg in resources folder.

Sitecore (sitecore social connector) - unable to customize content posted to facebook/twitter

I've recently installed the sitecore social connector module, and I've placed tweet and like buttons on a page, but I can't seem to control the content either sends to twitter/facebook. The tweet button sends the title of the page as the text to be tweeted, and I'd like to override this.
The facebook like link doesn't seem to do anything. If I go back to the same page, it still shows 1 like, but nothing has appeared on my facebook page.
Any help would be greatly appreciated.
I've decompiled the CodeBehind for the Tweet sublayout and it has this for code:
protected void Page_Load(object sender, EventArgs e)
{
string text = "var xmlhttp;if (window.XMLHttpRequest){ xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");}xmlhttp.open(\"GET\",url,true);xmlhttp.send();";
string script = string.Format("<script>twttr.events.bind('tweet', function (event) {{var url = '{2}?itemid={1}&eventname={3}&buttontype=tweet';{4}}});</script>", new object[]
{
Sitecore.Context.User.Name.Replace('\\', '.'),
Sitecore.Context.Item.ID.ToString(),
"/layouts/system/Social/SocialEvents.aspx",
base.EventName,
text
});
this.Page.RegisterStartupScript("tweetsubscribe", script);
}
If you want to change it, you need to de-compile Sitecore.Social.dll which is in the package. Un-zip the package and open the files folder and the DLL will be in the /bin/.
If you don't have a decompiler, ILSpy is a great free one. You can do the same for the other feature, just de-compile and re-build in a local project with changes.
Update: just to clarify, you need to de-compile the current C# in the DLL to make changes to it. You can re-compile into a separate project, you just need to change the Inherits="" in the front-end of the control, e.g.
Instead of this:
Inherits="Sitecore.Social.Sharing.Controls.TweetButton"
Do something like this:
Inherits="MyProject.Sharing.Controls.TweetButton"
Apologies for the very late reply. I did not realise someone had asked me for a reply.
In the end I found it easier to just use the standard Twitter/Facebook controls. I have since learned that while Sitecore has some useful modules for handling CMS operations, it is often easier on the Content Delivery side to just use whatever web technology is the easiest to implement.
https://dev.twitter.com/web/tweet-button
https://developers.facebook.com/docs/plugins/share-button?locale=en_GB

Customizing Containable Content in Orchard CMS

I am currently trying to understand a bit more about how Orchard handles Lists of Custom Content Types and I have run into a bit of an issue.
I created a Content Type named Story, which has the following parts:
Body
Common
Containable
Route
I created a list that holds these items, and all I am attempting to do is style them in such a way:
Story Title
Story Description (Basically a truncated version of the body?)
However, I cannot seem to figure out how to do the following:
Get the Title to actually appear (Currently all that appears is the body and a more link)
Remove the "more" link (and change this to be the actual Title)
I have looked into changing the Placement.info, and have looked all over in an attempt to find where the "more" link is added in each of the items. Any help would be greatly appreciated.
I finally managed to figure it out - Thanks to the Designer Tools Module, which made it very simple to go look into what was going on behind the scenes during Page Generation.
Basically - all that was necessary to accomplish this was to make some minor changes to the Parts.Common.Body.Summary.cshtml file. (found via ../Core/Common/Views/)
Which initially resembles the following:
#{
[~.ContentItem] contentItem = Model.ContentPart.ContentItem;
string bodyHtml = Model.Html.ToString();
var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString()
.Replace(Environment.NewLine,"</p>"+Environment.NewLine+"<p>"));
}
<p>#body #Html.ItemDisplayLink(T("more").ToString(), contentItem)</p>
however by making a few changes (by using the Designer Tools) I change it into the following:
#{
[~.ContentItem] contentItem = Model.ContentPart.ContentItem;
string bodyHtml = Model.Html.ToString();
string title = Model.ContentPart.ContentItem.RoutePart.Title;
string summary = Html.Excerpt(bodyHtml, 100) + "...";
}
<div class='story'>
<p>
#Html.ItemDisplayLink(title, contentItem)
</p>
<summary>
#summary
</summary>
</div>
Although it could easily be shortened a bit - It does make the styling quite a big easier to handle. Anyways - I hope this helps :)
Alternately you can use the placement.info file in your theme assign different fields to your Summary and Detail views. It's much simplier.
http://orchardproject.net/docs/Understanding-placement-info.ashx
But, I used the same method you did till I discovered the .info file as well. It works and gives you a good understanding of how the system works, but the placement.info file seems easier.
Also, you probably don't want to be editing the view files in Core. I think your meant to override views in your theme directory.