|
I have a routine that protect PDF's and sign them using Memorystream as the intermediary layer - I mean, the protected document is saved to a Memorystream and the sign process get it as the entry file. No problem at all.
Interesting notice that, if I put this routine in a concomitant task, I have the following problem during the final "SAVE" (the signing process) to a disk file, but SOMETIMES only:
Because sometimes the entry document is really a bunch of 20 documents (the general situation here), related to the process. And I'm trying to accelerate the process protecting-and-signing processing 2 files at once.
As I said, 95% of time (or files) the routine functions 100% but sometimes 1 or 2 files raises the above error - and it does not occur if I just sign the document, which does NOT involve the usage of "Memorystream". In those cases, the routine process disk files directly (input and output). Interesting notice that the Memorystream is not shared or public (it is created within the method).
|
We have tried to reproduce the reported issue with 20 PDF documents in multi-threading with protecting and signing PDF documents. But we regret to let you know that we were unable to reproduce it. Please find the sample from which we tried from below,
Could you please provide us the below details, it will helpful for us to provide the precise solution on this.
|
|
Even bypassing the error using a deviation based on TRY-CATCH (and calling again the SAVE method), in some files I get:
Even creating a CLASS with all signing procedures there and loading it twice (each one for each thread/task) I have the same behaviour: the SAVE procedure raises an error ("the collection was modified, maybe the enumeration operation won't be executed"). |
Could you please provide us the below details, it will helpful for us to provide the precise solution on this.
|