The code extract is below. Any help appreciated.
- Code: Select all
bool blFirstRect = true;
PdfPageBase page = pdfText.SearchPage;
foreach (RectangleF rect in pdfText.Boundses)
{
if ((blFirstRect)&&(strLabel!=" "))
{
pdfText.ApplyRecoverString(strLabel, colRedactColor, false);
blFirstRect = false;
}
}
at System.Drawing.SafeNativeMethods.Gdip.GdipGetLogFontW(HandleRef font, HandleRef graphics, Object lf)
at System.Drawing.Font.ToLogFont(Object logFont, Graphics graphics)
at System.Drawing.Font.ToLogFont(Object logFont)
at System.Drawing.Font.ToHfont()
at spr.ᜀ(Font A_0)
at spr.ᜈ()
at spr.ᜋ()
at Spire.Pdf.Graphics.PdfTrueTypeFont.ᜀ(Font A_0)
at Spire.Pdf.General.Find.PdfTextFind.ApplyRecoverString(String newvalue, Color backColor, Boolean unicode)
at GSRedactor.RedactTextBoundary(PdfTextFind pdfText, String strLabel) in W:\Source\source\Grain Silo\GrainSiloRedactor.cs:line 2752
at GSRedactor.RedactPDF(PdfDocument pdfSource, String strSourceFile, String strTargetFile, Dictionary`2 dictRedactees, List`1 listRedactShapes, List`1 listDeletedPages, RedactOptions roOptions, RedactMode rmMode, Boolean blRemoveOCR, Boolean blMinimizeFileSize, Int32 iFirstPage, Int32 iLastPage, String strWatermarkText) in W:\Source\source\Guardum\Grain Silo\GrainSiloEngine\GrainSiloRedactor.cs:line 1427
at GSRedactor.RedactPDF(String strSourceFile, String strTargetFile, Dictionary`2 dictRedactees, List`1 listRedactShapes, List`1 listDeletedPages, RedactOptions roOptions, RedactMode rmMode, Boolean blRemoveOCR, Boolean blMinimizeFileSize, Int32 iFirstPage, Int32 iLastPage, String strPassword, String strWatermarkText) in W:\Source\source\Guardum\Grain Silo\GrainSiloEngine\GrainSiloRedactor.cs:line 1151
at GSRedactor.RedactFile(String strSourceFile, String strTargetFile, Dictionary`2 dictRedactees, List`1 listRedactShapes, List`1 listDeletedPages, RedactOptions roOptions, RedactMode rmMode, Boolean blRemovePDFOCR, Boolean blMinimzeFileSize, Int32 iFirstPage, Int32 iLastPage, List`1 listExcelRanges, String strPassword, String strWatermarkText) in W:\Source\source\Guardum\Grain Silo\GrainSiloEngine\GrainSiloRedactor.cs:line 876
at ProcessRedactionProgress.RedactSARFile(Dictionary`2 dictSARFiles, String strFileName, String strArchiveFile, Dictionary`2 dictPersonalData, GSRedactor gsrRedactor, RedactOptions roRedactOptions, RedactMode rmRedactMode) in W:\Source\source\Guardum\Grain Silo\Guardum for TransPerfect\ProcessRedactionProgress.cs:line 552
at ProcessRedactionProgress.RedactorWorker(Object sender, DoWorkEventArgs e) in W:\Source\source\Grain Silo\4TP\ProcessRedactionProgress.cs:line 334
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()