Append multiple rtf files to a single pdf

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
Vories
User
Posts: 7
Joined: Mon Mar 21, 2005 11:12 pm

Append multiple rtf files to a single pdf

Post by Vories » Sun Feb 24, 2008 11:06 pm

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
Attachments
VBExample.zip
(16.59 KiB) Downloaded 215 times

Ivan - Tracker Software
Site Admin
Posts: 3591
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Post by Ivan - Tracker Software » Mon Feb 25, 2008 8:43 am

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.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

Vories
User
Posts: 7
Joined: Mon Mar 21, 2005 11:12 pm

OnPrintingFinished event not being triggered

Post by Vories » Mon Feb 25, 2008 7:48 pm

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
Attachments
VbExCOM.zip
(157.67 KiB) Downloaded 225 times

Ivan - Tracker Software
Site Admin
Posts: 3591
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Post by Ivan - Tracker Software » Wed Feb 27, 2008 10:28 am

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 ?
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

Vories
User
Posts: 7
Joined: Mon Mar 21, 2005 11:12 pm

Append pdf files OnPrintingFinished event not triggered

Post by Vories » Wed Feb 27, 2008 3:46 pm

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

Ivan - Tracker Software
Site Admin
Posts: 3591
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Post by Ivan - Tracker Software » Wed Feb 27, 2008 4:59 pm

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.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

Vories
User
Posts: 7
Joined: Mon Mar 21, 2005 11:12 pm

OnPrintingFinished event not being triggered

Post by Vories » Thu Feb 28, 2008 5:20 pm

What do you suggest?

John - Tracker Supp
Site Admin
Posts: 8202
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Fri Feb 29, 2008 11:06 am

Hi,

I suggest Version 4 - this is very nearly ready for release and would handle this better for you.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

Post Reply