Extract and show PDF links

Top  Previous  Next

Extracts the URLs of all links to PDF files and displays them in the web page.

 

Sub Wsw_PreProcessPage(Handle, ByRef sMemWeb, ByRef sStatusMessage, ByRef iStatusCode)

   

   Dim sl, i, sItem

   

   sl = GetAllWildcardMatches(sMemWeb, "<a *>")

   For i = 0 To StringList_ItemCount(sl) - 1

      sItem = StringList_GetItem(sl, i)

      If Pos(".pdf", sItem) > 0 Then

         sMemWeb = ReplaceText(sMemWeb, sItem, sItem + HtmlGetParam(sItem, "href"))

      End If

   Next

   

End Sub




Translate document: