Quantcast
Channel: PDFCreator - pdfforge forums
Viewing all articles
Browse latest Browse all 2637

An instance of PDFCreator is currently running

$
0
0

@StephenH1 wrote:

Thanks in advance for any assistance provided.
I developed a plugin for Revit utilising PDFCreator 3.5.1.7201 and receive the intermittent error "Access forbidden. An instance of PDFCreator is currently running" followed by "No COM Instance was found".
These errors occur rarely but mainly when the app is being used for the first time.
My code is very much based upon the sample code
private pdfforge.PDFCreator.UI.ComWrapper.Queue CreateQueue()
{
if (!m_isTypeInitialized)
{
Type queueType = Type.GetTypeFromProgID("PDFCreator.JobQueue");
Activator.CreateInstance(queueType);
m_isTypeInitialized = true;
}
return new pdfforge.PDFCreator.UI.ComWrapper.Queue();
}

public void PDFMergePrint()
{
int numberOfJobs = 0;
var jobQueue = CreateQueue();
try
{
jobQueue.Initialize();
{

    if (!jobQueue.WaitForJobs(numberOfJobs,15))
        {

''''''''''''''''''''''
}
MainData.MyMessageBox("Print jobs did not reach the queue within 15 seconds.");
}
else
{
jobQueue.MergeAllJobs();
var printJob = jobQueue.NextJob;
m_pdfDataExport.PDFSettings(printJob);
printJob.ConvertTo(convertedFilePath);
if(!printJob.IsFinished||!printJob.IsSuccessful)
{
MainData.MyMessageBox("The Sheet/View could not be converted to a PDF.");
}
}
}
}
}
catch(Exception ex)
{
MainData.MyMessageBox("An error occurred: "+"Cover file does not exist.");
jobQueue.ReleaseCom();
PrintManagerProgressBar.Value = 0;
}
finally
{
jobQueue.ReleaseCom();
}

The principle of the code is above.
Any assistance is much appreciated

Regards
Stephen

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 2637

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>