I found one more issue related to
As you already know, when application thread enters
ContainsSignature, it may “hang” there for 40-60 seconds (see PDFNET-48659 reported above).
I tried to implement a temporary workaround until the issue is not fixed. The idea was to execute
ContainsSignature in the separate thread (will refer to it as signature thread) and abort it when timeout expires.
public static void TestPdfHelper(string p)
var started = DateTime.Now;
var pdf = new Document(p);
using (var pdfSign = new PdfFileSignature())
var IsDigitallySigned = true;
var spent = DateTime.Now - started;
var th = new Thread(() =>
Abort method does not abort signature thread. Probably, because signature thread is executing unmanaged code inside
- But what even worse, it seems that signature thread never exits
ContainsSignature method, if
Thread.Abort is called.
I tested with the PDF document attached in the first post. I waited for more than 20 minutes and signature thread was still somewhere in the
ContainsSignature method. One more time, to make it clear.
Thread.Abort is not called,
ContainsSignature finishes in approximately 30 seconds (PDFNET-48659).
Thread.Abort is called, then signature thread is not aborted and never exits