mypattern=“押题|www.yidingguo”
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber(mypattern);
textFragmentAbsorber.TextSearchOptions.IsRegularExpressionUsed = true;
pdfDocument.Pages.Accept(textFragmentAbsorber);
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
RedactionAnnotation ra = new RedactionAnnotation(textFragment.Page, myrectange);
if (textFragment.TextState.Rotation!= 0){
textFragment.text="";
}
Error message:
System.ArgumentException: Invalid index: index should be in the range [1…n] where n equals to the operators count.
在 Aspose.Pdf.OperatorCollection.#=zNYeQGlZt2qRnhBAvhCHtAyg=(Int32 #=zTt58Pcs=)
在 #=zdcZDrO$CfWmPF8bE9CCticjG7Mqv1wgvMK1m7mbWZTTkn$VnWNy9NDc=.#=z__$VyYzMM53S(#=zzEXskTc= #=z_MIeuFI=)
在 #=zk_baTkeGsSyYK2fUlwbWQQdqJBHEBQqcIHGujE4wtcfm_Qaxg6hVLHA=.#=zCv358O0=(TextEditOptions #=zRGbBioo=)
在 Aspose.Pdf.Text.TextSegment.#=z$K9TIfjRNqx1()
在 Aspose.Pdf.Text.TextSegmentCollection.#=zCv358O0=(Int32 #=zTt58Pcs=)
在 Aspose.Pdf.Text.TextFragment.#=z65$gx016ti387NWqjPDln7Y=()
在 Aspose.Pdf.Text.TextFragment.set_Text(String value)
在 Aspose.Pdf.Examples.CSharp.AsposePDF.Text.ReplaceTextAll.Run(String mypattern, String filepath, String StepProc)
input.pdf (334.4 KB)