Private Const CONST_PDFCreatorProgID As String = "PDFCreator.PDFCreatorObj"
Private Const CONST_PDFCreatorJobQueueProgID As String = "PDFCreator.JobQueue"
Private Const CONST_ProfileGuid As String = "DefaultGuid"
Private Const SETTINGS_OpenViewer As String = "OpenViewer"
Private Const SETTINGS_ShowProgress As String = "ShowProgress"
' test PDFCreator
Dim PDF as Object = CreateObject(CONST_PDFCreatorProgID)
If PDF.IsInstanceRunning Then
Throw New Exception("...")
End If
' inicialization
Dim Queue As Object = Nothing
Try
' construction printing queue
Queue = CreateObject(CONST_PDFCreatorJobQueueProgID)
Queue.Initialize()
' some print to PDFCreator printer
.....
' waiting for job (timeout 10s)
If Not Queue.WaitForJob(10) Then
Throw New Exception("...")
Else
' getting job and settings
Dim Job As Object = Queue.NextJob
' default profile
Job.SetProfileByGuid(CONST_ProfileGuid)
Job.SetProfileSetting(SETTINGS_OpenViewer, "False")
Job.SetProfileSetting(SETTINGS_ShowProgress, "False")
' convert to PDF
Job.ConvertTo(OutputPDFFileName)
' test
If Not (Job.IsFinished OrElse Job.IsSuccessful) Then
Throw New Exception("...")
Else
' call after save PDF
RaiseEvent AfterSavePDF(OutputPDFFileName)
End If
End If
Catch ex As Exception
Throw
Finally
' release queue
If Not IsNothing(Queue) Then Queue.ReleaseCom()
End Try
I encounter the same kinf of pb with the version 2.5.0, do you have any news about the problem ?
For my case, I use PDF Creator with the COM interface from a Java program
In my java program
The first call ReleaseCom is ok
The second ReleaseCom call is ok
But always at the 3rd call of ReleaseCom, my program is frozen
Al these calls are done from the same main process
But if I call 3 times my java program (so 3 differents process), I have not the problem
I am afraid we didn’t find out anything about this problem. Please check if any errors are logged in the PDFCreator log. It might also help to set the logging level to trace, as this will log almost every step and perhaps help to find out what is different if you make the calls from 3 different processes.
I can confirm that this occurs for me using 2.5.2 in a python 2.7 script. The third time the script calls ReleaseCom the script hangs. I have reverted to an older release and it is working fine.
I just created a test VBA makro to test this and there was no problem.
The makro does nothing else than initializing and releasing the COM
object, so there must be some additional conditions causing the error.
One thing that puzzles me when re-reading all this is, why would it be required to release the PDFCreator COM object multiple times in the same script? It should be sufficient to release it once at the end. Perhaps I am overlooking something really obvious here, sorry in that case
I’m having the same problem. We use version 2.5.
We use it on a non-UI thread (backgroundworker).
If I pause the application and check the “Parallel Stack” I see this (from “old” te recent):
<
Queue.ReleaseCom
QueueAdapter.ReleaseCom
PipeServer.Stop
Pipeserver.ReleaseMutex
Dispatcher.LegacyInvokeImpl
DispatcherOperation.Wait
DispatcherOperationEvent.WaitOne
WaitHandle.WaitOne
WaitHandle.InternalWaitOne
We use it in a function which creates two pdf’s. And we use the first created pdf as the background of the second one. It never freezes on the creation of the first pdf, always on the second.
And it never freezes on the first action (so the creation of two pdf’s).
I have the same problem with 3.2 version. Ended up reusing the same Queue object for the whole application without running ReleaseCom. Also I had to delete the file before writing to it with the printer, it does not overwrite.
Hello everybody, firstly i am apologize for long pause, but i had not a time and version 2.3 working perfectly.
Now I can continue in research for errors with converting to PDF.
I installed version 3.2 of PDFCreator.
Here is two logs:
Converting first PDF
Converting second PDF
Result: PipeServer.Stop is freezing in some step = Can you append more debug messages to source code?
I can ask our team to add more debug messages here, but it might take a while until these show up in a new PDFCreator release. It doesn’t seem to be a general issue, I can run any of the released sample scripts (I randomly selected about 5, didn’t actually go through them all) as many times in a row as I like without PDFCreator freezing on ReleaseCOM.