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

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.

Related

Aspose slide include svg into ppt slide

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,

MVC - Strip unwanted text from rss feed

Ive got the following code in my RSS consumer (Vandelay Industries RemoteRSS) in my Orchard CMS implementation:
#using System.Xml.Linq
#{
var feed = Model.Feed as XElement;
}
<ul>
#foreach(var item in feed
.Element("channel")
.Elements("item")
.Take((int)Model.ItemsToDisplay))
{
<li>#T(item.Element("description").Value)</li>
}
</ul>
The rss feed Im using is from Pinterest, and this bundles the image, link, and a short description all inside the 'description' elements of the feed.
<description><a href="/pin/215609900882251703/"><img src="http://media-cache-ec2.pinterest.com/upload/88664686384961121_UIyVRN8A_b.jpg"></a>How to install Orchard CMS on IIS Server</description>
My issue is that I don't want the text bits, and I also need to prefix the 'href=' links with 'http://www.pinterest.com'.
I've managed to edit the original code with my newbie skills to the above,, which essentially displays the images as links which are only relative and thus pointing locally to my server. These images are also then followed by the short description.
So to summarise, I need a way to prefix all links with 'http://pinterest.com' and then to remove the fee text after the image/links.
Any pointers will be greatly appreciated, Thanks.
You should probably parse the description, with something like http://htmlagilitypack.codeplex.com/, and then tweak it to add the prefix. Or you can learn regular expression and do without a library. Could be a little trickier and error-prone however.

Drupal webform into front page template

I need to add a webform to my page-home.tpl but I'm really new on Drupal so I need a really clear help...
I'm using DRUPAL 6 and I have created the webform.
I would like to add the webform to my custom template just adding the php code to the tpl file. My webform id is id="webform-client-form-20".
Can you help me ?
Thanks a lot
The quickest (not necessarily best) way to do it is using a combination of node_view() and node_load():
$nid = 20; // Node ID of the webform.
$webform_node = node_load($nid);
echo node_view($webform_node);
You'd be better off loading that into a variable in a preprocess function than outputting it directly in the theme but this should work for your purposes.

Create or Change multipage TIFFs

I try to compose new and modify existing multipage TIFFs using Magick++.
Does someone know how I can do this?
I can read a specific page using this code:
Image * img = new Image("path/to/image.tif[0]"); //read page 0
But how can I save changes back to the TIFF? and how can I add new pages?
Google could only tell me things about splitting TIFFs in singe page ones.
Thanks for your help!
I never tried it but what about the writeImages function. Docs are here.
From the docs
Write images in container to file specified by string imageSpec_

Translate xml content using web service API from Ektron CMS400.Net

First of all: I'm on Ektron CMS v8.1
I'm having a problem with dynamicly adding translated content to the cms via the Webservice API. I can perfectly add xml content by using the following object and method:
ContentSoapClient csc = new ContentSoapClient("ContentSoap");
csc.AddContent3(...);
I specify a language and the xml content gets inserted. But now I want to add a translated version of the xml to the cms. So I want it to have the same contentId!
Anyone has an idea on this? The only method in the csc object that recieves a contentId is 'csc.AddContent2(..)' But that doesn't import anything and just gives me an error saying my xml is incorrect. While my xml is correct..I checked it!
Thanks!
Found the answer..
Ektron apparantly uses alot of asmx files and I only checked the "/workarea/webservices/WebServiceAPI/Content/Content.asmx" webservice. I found the method 'AddTranslatedXMLContent()' I need in the "/Workarea/webservices/ContentWS.asmx" webservice.
I wish they just cleaned up their API... Would save us a lot of trouble.
Firstly, I haven't used the ContentSoapClient class and can't find any documentation on it.
Ektron often takes a language id when you create the API object. See if the ContentSoapClient contructor can take a Language Id.