Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>@Jcis, I actually managed a workaround for handling multiple searches using your example as a starting point. I use your project as a reference in a c# project, and altered what it does. Instead of just highlighting I actually have it drawing a white rectangle around the search term, and then using the rectangle coordinates, place a form field. I also had to swap the contentbyte writing mode to getovercontent so that I block out the searched text entirely. What I actually did was to create a string array of search terms, and then using a for loop, I create as many different text fields as I need.</p> <pre><code> Test.Form1 formBuilder = new Test.Form1(); string[] fields = new string[] { "%AccountNumber%", "%MeterNumber%", "%EmailFieldHolder%", "%AddressFieldHolder%", "%EmptyFieldHolder%", "%CityStateZipFieldHolder%", "%emptyFieldHolder1%", "%emptyFieldHolder2%", "%emptyFieldHolder3%", "%emptyFieldHolder4%", "%emptyFieldHolder5%", "%emptyFieldHolder6%", "%emptyFieldHolder7%", "%emptyFieldHolder8%", "%SiteNameFieldHolder%", "%SiteNameFieldHolderWithExtraSpace%" }; //int a = 0; for (int a = 0; a &lt; fields.Length; ) { string[] fieldNames = fields[a].Split('%'); string[] fieldName = Regex.Split(fieldNames[1], "Field"); formBuilder.PDFTextGetter(fields[a], StringComparison.CurrentCultureIgnoreCase, htmlToPdf, finalhtmlToPdf, fieldName[0]); File.Delete(htmlToPdf); System.Array.Clear(fieldNames, 0, 2); System.Array.Clear(fieldName, 0, 1); a++; if (a == fields.Length) { break; } string[] fieldNames1 = fields[a].Split('%'); string[] fieldName1 = Regex.Split(fieldNames1[1], "Field"); formBuilder.PDFTextGetter(fields[a], StringComparison.CurrentCultureIgnoreCase, finalhtmlToPdf, htmlToPdf, fieldName1[0]); File.Delete(finalhtmlToPdf); System.Array.Clear(fieldNames1, 0, 2); System.Array.Clear(fieldName1, 0, 1); a++; } </code></pre> <p>It bounces the PDFTextGetter function in your example back and forth between two files until I achieve the finished product. It works really well, and it would not have been possible without your initial project, so thank you for that. I also altered your VB to do the text field mapping like so;</p> <pre><code> For Each rect As iTextSharp.text.Rectangle In MatchesFound cb.Rectangle(rect.Left, rect.Bottom + 1, rect.Width, rect.Height + 4) Dim field As New TextField(stamper.Writer, rect, FieldName &amp; Fields) Dim form = stamper.AcroFields Dim fieldKeys = form.Fields.Keys stamper.AddAnnotation(field.GetTextField(), page) Fields += 1 Next </code></pre> <p>Just figured I would share what I managed to do with your project as a backbone. It even increments the field names as I need them to. I also had to add a new parameter to your function, but that's not worth listing here. Thank you again for this great head start.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload