User login

Who's online

There are currently 0 users and 64 guests online.

Advertisements


SourceForge.net Logo

0.9.5 Freezes on cClose

Submitted by Stremit on Wed, 2008-04-30 15:29.

Hi all,

I have searched the forum and found lots of references to PDFCreator "freezing" but failed to find a definitive answer to the problem. This is my first day using PDFCreator and could do with some expert advice.

I am using:
Windows XP Pro
MS Excel 2003
PDFCreator 0.9.5
Creating a print to pdf VB macro controlled from a button control on an excel worksheet.
Using early binding technique

Whenever i let the macro "free run" it hangs on the cClose command. PDFCreator doesnt close, sits in the task list consuming 100% procesor time and excel eventually reports an error "waiting for application to complete OLE activity"
If i put a breakpoint in just above the cClose command and then single step everything is fine. I assumed that this was a timing thing so tried to put a few "waits" in before the cClose but with no success.

Can anyone suggest a robust solution to this problem, I have attached the code fragment I am using (based on the example on the web)?

...

'Wait until all print jobs have entered the print queue
Do Until pdfjob.cCountOfPrintjobs = 2
DoEvents
Loop

'Combine all PDFs into a single file and stop the printer
With pdfjob
.cCombineAll
.cPrinterStop = False
End With

'Wait until PDF creator is finished then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
pdfjob.cClose
Set pdfjob = Nothing
End Sub

Submitted by SAMMYPE on Wed, 2008-05-07 22:28.

Hello Stremit, I'm new with PDFCreator too. Here I post a progam snip, sorry with german comment, that is working fine in my VB environment. It is called in a loop and converted some (500) *.doc into *.pdf via VPN!

:-) Hendrik

'before use PDFMake():
Private WithEvents moPdf As PDFCreator.clsPDFCreator
Set moPdf = New PDFCreator.clsPDFCreator

Private Sub PDFMake(ByVal sSrcFullFileName As String, ByVal sDstDir As String, ByVal sDstFile As String)
'** HENDRIK 20080504T11:13
':: erzeugt ein PDF-File aus dem SourceFile
'!! benutzt wird moPDF, ist bereits erzeugt!
'-> sSrcFullFileName: Voller Dateiname (Path + Extenntion)
'-> sDstDir: Zieldirectory
'-> sDstFile: Zieldatei ohne extention
'

© 2006 by pdfforge.org :: Contact us

Validate XHTML or CSS.