Page 1 of 1

Append multiple rtf files to a single pdf

Posted: Sun Feb 24, 2008 11:06 pm
by Vories
I have attached some code that works when I walk thru it with the debugger but displays the Save As dialog when run normally.

I am trying to append 6 files into a single pdf.

Any ideas?

Thanks

Posted: Mon Feb 25, 2008 8:43 am
by Ivan - Tracker Software
ShellExecute function doesn't wait while runned process will finish printing and exit. I'm afraid you need to use Driver ActiveX API to do what you need. And using this API you will need to run each next printing only when previous printin will fire even OnFileSaved.

OnPrintingFinished event not being triggered

Posted: Mon Feb 25, 2008 7:48 pm
by Vories
I moved my code to the VB COM example as you suggested and the results are very promising.
Randomly (and not often, hard to reproduce) I get an error of "Process cannot access file" (See Attached).

I am printing the next file for append on the event OnFileSaved because I never get the OnPrintingFinished event.

Application code attaached.

Any ideas,

thanks

Posted: Wed Feb 27, 2008 10:28 am
by Ivan - Tracker Software
Looks like another application doesn't allow PDF-XChange to open file for writting. Maybe there is AV software installed which checks files on the fly ?

Append pdf files OnPrintingFinished event not triggered

Posted: Wed Feb 27, 2008 3:46 pm
by Vories
I don't understand. I never get this event, even when the file is written and appended properly. Did you run my application (from the previous download) and get the event to fire?

thanks,

vories

Posted: Wed Feb 27, 2008 4:59 pm
by Ivan - Tracker Software
I'm having the following sequence of Debug prints:

Code: Select all

Sample1.rtf  27.02.2008 18:52:56
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample2.rtf  27.02.2008 18:52:57
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample3.rtf  27.02.2008 18:52:58
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample4.rtf  27.02.2008 18:52:59
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample5.rtf  27.02.2008 18:53:00
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample2.rtf  27.02.2008 18:53:01
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample3.rtf  27.02.2008 18:53:02
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample4.rtf  27.02.2008 18:53:03
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample5.rtf  27.02.2008 18:53:04
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved

Sample6.rtf  27.02.2008 18:53:06
OnPrintingStarted
OnPageStarted
OnPageFinished
OnPageStarted
OnPageFinished
dwState: 2
OnFileSaved
Finished
008 18:42:05
But sometimes (especially when first run on clearly booted OS) save as dialog appears before any event fired.
By design, V3 fires events via messages with timeout of 1 second, and if there are any troubles with event handling during this period, event will be lost.

OnPrintingFinished event not being triggered

Posted: Thu Feb 28, 2008 5:20 pm
by Vories
What do you suggest?

Posted: Fri Feb 29, 2008 11:06 am
by John - Tracker Supp
Hi,

I suggest Version 4 - this is very nearly ready for release and would handle this better for you.