Profile Picture

Iterate Hyperlinks/Images in the Document

Posted By Clint Carter 5 Years Ago
Author
Message
Clint Carter
Question Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 3, Visits: 6
How do you iterate/find all images in a document?
I want to find and delete them...

I need to find all hyperlinks inside the document.
I need to get the URL from each hyperlink.

How is this done? 





Nevron Support
Posted 5 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)Supreme Being (4,098 reputation)

Group: Forum Members
Last Active: 9 hours ago
Posts: 2,970, Visits: 3,394

Hi Clint,

The following code collects all images found in a text document:
NList<NNode> imageInlines = richTextView.Content.GetDescendants(NImageInline.NImageInline);
similarly for hyperlinks the code is:
NList<NNode> hyperlinkInlines = richTextView.Content.GetDescendants(NHyperlink.NHyperlinkSchema);

Regarding the hyperlink url:
NHyperlinkInline hyperlinkInline = (NHyperlinkInline)hyperlinks[0];
string url = (hyperlinkInline.Hyperlink as NUrlHyperlink).Url;

Hope this helps - let us know if you meet any problems.



Best Regards,
Nevron Support Team



Clint Carter
Posted 5 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 5 Years Ago
Posts: 3, Visits: 6
Thanks.



Similar Topics


Reading This Topic