@BartC wrote:
Hi,
I’m using the PDFCreator.ComWrapper.dll version 3.1.0.10222.
I use Visual Studio 2017 and the code is C#.Sometimes PDFCreator freezes when I convert a Word document to pdf.
I created a testproject for reproduction. The problem occurs when I use a backgroundworker to convert word documents to pdf’s and I restart the backgroundworker.The testproject contains a form with
- a richtextbox (richTextBox1) for info
- 2 textboxes (textWordBackgroundDocument and textWordBaseDocument) for the fullnames of the word document to be converted
- a button (button1)
Code should be put here, but I get an error that new members ain’t allowed to add links and uploading a txt file is also not allowed. It’s kinda essential of course
So I’ll describe what I do. I have a method creating 4 times a PDF based on a word document converted to a PDF with a background of another word document which is converted to a PDF. I do this within a backgroundworker.
I can create this “backgrounded” (stamped) PDF as much as I like within the backgroundworker (I did it 100 times and it was ok).
The problem occurs when I set a timer to 1 minute after the 4 “backgrounded” PDFs are create and redo it. Then the background PDF is created, but the “backgrounded” PDF gets stuck. If I don’t wait with a timer, but push the button manually when it’s done it works good as well, unless I wait some time. Very strangeThe only thing that you need to do is install PDFCreator 3.1, add a reference in the project to the PDFCreator.ComWrapper.dll (located in the Program Files - PDFCreator folder), run the program.
Fill in the full filenames of the word document containing the background and the normal word document (which needs to be converted to pdf with the other word document as background).The output (in the richedit) when it freeze is:
12:14:45:1124: Start
12:14:45:1264: Start … 0%
12:14:45:1264: Create background 1 … 0%
12:14:51:7663: Create stamped PDF 1 … 12%
12:14:55:9472: Create background 2 … 25%
12:14:59:7012: Create stamped PDF 2 … 37%
12:15:03:1415: Create background 3 … 50%
12:15:06:6098: Create stamped PDF 3 … 62%
12:15:10:0645: Create background 4 … 75%
12:15:13:7053: Create stamped PDF 4 … 87%
12:15:17:1166: Done. … 100%
Success
Stop: 12:15:17:1201
12:15:17:1201: Timer set to 1 minute…
12:16:17:1105: Start
12:16:17:1145: Start … 0%
12:16:17:1165: Create background 1 … 0%
12:16:21:5750: Create stamped PDF 1 … 12%When I pause the program, turn off “Enable Just My Code” and then look at the “Parallel Stacks” window then I see that it is stuck on aQueue.ReleaseCom().
The stack of that thread shows:
- Form1.ABgw_DoWork
- Form1.CreateStampedPDF
- Queue.ReleaseCom
- [Lightweight Function]
- QueueAdapter.ReleaseCom
- PipeServermanager.ShutDown
- PipeServer.Stop
- PipeServer.ReleaseMutex
- Dispatcher.LegacyInvakeImpl
- DispatcherOperation.Wait
- DispatcherOperationEvent.WaitOne
- WaitHandle.WaitOne
- WaitHandle.InternalWaitOne
I tried it on 2 different machines and it always freezes.
Any help is welcome.
Kind Regards,
Bart
Posts: 1
Participants: 1