GroupDocsGists
10/19/2017 - 10:59 AM

RemoveArtifactsWithParticularTextFormatting.vb

' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using doc As PdfDocument = Document.Load(Of PdfDocument)(Utilities.MapSourceFilePath(FilePath))
    For Each page As PdfPage In doc.Pages
        For i As Object = page.Artifacts.Count - 1 To 0 Step -1
            For Each fragment As Object In page.Artifacts(i).FormattedTextFragments
                If fragment.Font.Size > 42 Then
                    page.Artifacts.RemoveAt(i)
                    Exit For
                End If
            Next
        Next
    Next
    doc.Save()