Hi.
i try to replace Email by regular Expression.
but this is not work.
i am send a code and file
Dim errText as string = ""
Dim fileName As String = Request("fileName") : if fileName = "" then errText = "Error: fileName is empty"
Dim logoUrl = ""
Dim fileArr = split(fileName,".")
Dim fileType = fileArr(ubound(fileArr))
' ---==== 1.0 if this binary filel
if fileName <> "" then
if lcase(fileType)="pdf" then
Dim pdfDocument As new Aspose.pdf.Document(fileFolder + fileName)
' Create TextAbsorber object to find all the phrases matching the regular expression
Dim textFragmentAbsorber As new TextFragmentAbsorber("[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+")
' Set text search option to specify regular expression usage
Dim textSearchOptions As new TextSearchOptions(true)
textFragmentAbsorber.TextSearchOptions = textSearchOptions
' Accept the absorber for a single page
' pdfDocument.Pages[1].Accept(textFragmentAbsorber)
' Get the extracted text fragments
Dim textFragmentCollection As TextFragmentCollection = textFragmentAbsorber.TextFragments
' Update text and other properties
For Each textFragment As TextFragment In textFragmentCollection
textFragment.Text = "New Phrase"
Next
' Dim logoStream As New MemoryStream()
' pdfDocument.Save(logoStream, Aspose.pdf.SaveFormat.pdf)
Response.Clear()
Response.ClearContent()
Response.ClearHeaders()
Response.AddHeader("Content-Description", "File Transfer")
Response.ContentType = "application/pdf"
Response.AddHeader("content-disposition", "attachment; filename=test.pdf")
Response.AddHeader("Content-Transfer-Encoding", "binary")
' logoStream.WriteTo(Response.OutputStream)
pdfDocument.Save(fileFolder + fileName)
' response.Write(pdfDocument)
response.end
end if
152227CV Aleksandra Tomina.pdf (656.0 KB)
152227CV Aleksandra Tomina.pdf (656.0 KB)