हाइपरलिंक
Contents
[
Hide
]
यह लेख आकारों पर हाइपरलिंक जोड़ने, प्राप्त करने, हटाने और अद्यतन करने को Aspose.Slides for .NET के उपयोग से प्रदर्शित करता है।
हाइपरलिंक जोड़ें
एक आयताकार आकार बनाएं जिसमें एक हाइपरलिंक बाहरी वेबसाइट की ओर संकेत करता हो।
static void AddHyperlink()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
var shape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 50, 150, 50);
shape.TextFrame.Text = "Aspose";
var textPortion = shape.TextFrame.Paragraphs[0].Portions[0];
textPortion.PortionFormat.HyperlinkClick = new Hyperlink("https://www.aspose.com");
}
हाइपरलिंक तक पहुंचें
एक आकार के टेक्स्ट भाग से हाइपरलिंक सूचना पढ़ें।
static void AccessHyperlink()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
var shape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 50, 150, 50);
shape.TextFrame.Text = "Aspose";
var textPortion = shape.TextFrame.Paragraphs[0].Portions[0];
textPortion.PortionFormat.HyperlinkClick = new Hyperlink("https://www.aspose.com");
var hyperlink = shape.TextFrame.Paragraphs[0].Portions[0].PortionFormat.HyperlinkClick;
}
हाइपरलिंक हटाएं
एक आकार के टेक्स्ट से हाइपरलिंक साफ़ करें।
static void RemoveHyperlink()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
var shape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 50, 150, 50);
shape.TextFrame.Text = "Aspose";
var textPortion = shape.TextFrame.Paragraphs[0].Portions[0];
textPortion.PortionFormat.HyperlinkClick = new Hyperlink("https://www.aspose.com");
textPortion.PortionFormat.HyperlinkClick = null;
}
हाइपरलिंक अपडेट करें
मौजूदा हाइपरलिंक के लक्ष्य को बदलें। HyperlinkManager का उपयोग करके ऐसे टेक्स्ट को संशोधित करें जिसमें पहले से हाइपरलिंक मौजूद हो, जो दर्शाता है कि PowerPoint सुरक्षित रूप से हाइपरलिंक को कैसे अपडेट करता है।
static void UpdateHyperlink()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
var shape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 50, 150, 50);
shape.TextFrame.Text = "Aspose";
var textPortion = shape.TextFrame.Paragraphs[0].Portions[0];
textPortion.PortionFormat.HyperlinkClick = new Hyperlink("https://old.example.com");
// मौजूदा टेक्स्ट के भीतर हाइपरलिंक को बदलने के लिए इसे उपयोग किया जाना चाहिए
// HyperlinkManager का उपयोग करके, सीधे प्रॉपर्टी सेट करने के बजाय।
// यह दिखाता है कि PowerPoint हाइपरलिंक को सुरक्षित रूप से कैसे अपडेट करता है।
textPortion.PortionFormat.HyperlinkManager.SetExternalHyperlinkClick("https://new.example.com");
}