Profile Picture

Iterate Hyperlinks/Images in the Document

Posted By Clint Carter 8 Years Ago
Author
Message
Clint Carter
Question Posted 8 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: 8 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 8 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: 6 hours ago
Posts: 3,054, Visits: 3,991

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 8 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: 8 Years Ago
Posts: 3, Visits: 6
Thanks.



Similar Topics


Reading This Topic