PDF Creator 2.4.1 Freeze on Queue.ReleaseCom


#1

Hello, I have a problem with the conversion to PDF in version 2.4.1 in COM interface.

The first file will be converted correctly, including the release of COM.
The second file was also converted, but the call Queue.ReleaseCOM freezes.

In version 2.3, everything worked properly.


#2

Hi,

could you provide a small code snippet to reprocude this?

Best regards,

Robin


#3
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

#4

Hi,

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


#5

Hi,

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.

Best regards,

Robin


#6

Hi,

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.

Cheers,

Sam


#7

Hi,

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 :slight_smile:

Best regards,

Robin


#8

Hi Robin,

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).

Any help would be appreciated :slight_smile:

Kind Regards,
Bart


#9

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.


#10

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:

  1. Converting first PDF
  2. Converting second PDF

Result: PipeServer.Stop is freezing in some step = Can you append more debug messages to source code?

First conversion - releasing COM OK

2018-05-21 13:20:46.9897 [Trace] 14824-44 () pdfforge.PDFCreator.Core.Workflow.JobRunner.LogOutputFiles: Created 1 output files.
2018-05-21 13:20:47.0078 [Trace] 14824-44 () pdfforge.PDFCreator.Core.Workflow.JobRunner.LogOutputFiles: 1. Output file: C:\TEST\PDF\TEST1.pdf
2018-05-21 13:20:47.0078 [Trace] 14824-44 () pdfforge.PDFCreator.Core.Workflow.JobRunner.CallActions: Starting Actions
2018-05-21 13:20:47.0078 [Debug] 14824-44 () pdfforge.PDFCreator.Core.Workflow.JobRunner.CleanUp: Cleaning up after the job
2018-05-21 13:20:47.0279 [Trace] 14824-44 () pdfforge.PDFCreator.Core.Workflow.JobRunner.RunJob: Job finished successfully
2018-05-21 13:20:47.0279 [Trace] 14824-44 () pdfforge.PDFCreator.Core.Workflow.JobRunner.RunJob: Calling job completed event
2018-05-21 13:20:47.0378 [Trace] 14824-44 () pdfforge.PDFCreator.Core.ComImplementation.PrintJobAdapter.DoConversion: COM: Removing jobinfo from the queue.
2018-05-21 13:20:47.0378 [Trace] 14824-44 () pdfforge.PDFCreator.Core.ComImplementation.QueueAdapter.ReleaseCom: COM: Cleaning up COM resources.
2018-05-21 13:20:47.0378 [Debug] 14824-44 () pdfforge.PDFCreator.Core.Communication.PipeServerManager.Shutdown: Stopping pipe server
2018-05-21 13:20:47.1211 [Trace] 14824-44 () pdfforge.PDFCreator.Core.ComImplementation.QueueAdapter.ReleaseCom: COM: Emptying queue.

Second conversion - PipeServer.Stop freeze:

2018-05-21 13:20:49.2237 [Trace] 14824-48 () pdfforge.PDFCreator.Core.Workflow.JobRunner.LogOutputFiles: Created 1 output files.
2018-05-21 13:20:49.2237 [Trace] 14824-48 () pdfforge.PDFCreator.Core.Workflow.JobRunner.LogOutputFiles: 1. Output file: C:\TEST\PDF\TEST2.pdf
2018-05-21 13:20:49.2237 [Trace] 14824-48 () pdfforge.PDFCreator.Core.Workflow.JobRunner.CallActions: Starting Actions
2018-05-21 13:20:49.2237 [Debug] 14824-48 () pdfforge.PDFCreator.Core.Workflow.JobRunner.CleanUp: Cleaning up after the job
2018-05-21 13:20:49.2437 [Trace] 14824-48 () pdfforge.PDFCreator.Core.Workflow.JobRunner.RunJob: Job finished successfully
2018-05-21 13:20:49.2437 [Trace] 14824-48 () pdfforge.PDFCreator.Core.Workflow.JobRunner.RunJob: Calling job completed event
2018-05-21 13:20:49.2437 [Trace] 14824-48 () pdfforge.PDFCreator.Core.ComImplementation.PrintJobAdapter.DoConversion: COM: Removing jobinfo from the queue.
2018-05-21 13:20:49.2568 [Trace] 14824-48 () pdfforge.PDFCreator.Core.ComImplementation.QueueAdapter.ReleaseCom: COM: Cleaning up COM resources.
2018-05-21 13:20:49.2568 [Debug] 14824-48 () pdfforge.PDFCreator.Core.Communication.PipeServerManager.Shutdown: Stopping pipe server


#11

Hi,

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.

Best regards

Robin


#12

Hi Robin,
thank you very much. I’ll test the new version as soon as it comes out.