Word to PDF conversion speed
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Tracker - Clarion Support, John - Tracker Supp, Support Staff, moderators
Word to PDF conversion speed
I'm using OfficeInside to convert Word documents to PDF. This is currently taking about 10 seconds per document which isn't too bad except when you have to do several hundred (or over 1,000 like I'm waiting on now.)
Any ideas/tips on how to speed the conversion process up. I'm sure most of the time is spent fooling around with MS Word and outside our control, but thought I'd ask.
--David
Any ideas/tips on how to speed the conversion process up. I'm sure most of the time is spent fooling around with MS Word and outside our control, but thought I'd ask.
--David
-
- Site Admin
- Posts: 8210
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Hi David,
Most likely this is going to be a question better asked of Capesoft - rather than us - although we will of course take a look.
I suspect much of the delay is caused opening the file in Word.
Most likely this is going to be a question better asked of Capesoft - rather than us - although we will of course take a look.
I suspect much of the delay is caused opening the file in Word.
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- Site Admin
- Posts: 1412
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
- Contact:
Why, whatever would make you think that?Tracker - Clarion Support wrote:...and Word is not a speedy product.

In a similar situation using OI for Word mailmerge, I ended up making a mailmerge "service" thread so that the init of Word was done once at my program startup. Similarly, Sean thinks reorganizing this code into a single process that only does the init once, converts all the docs and then kills the word object would be cleanest.
--David
-
- Site Admin
- Posts: 8210
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Hi David,
Yes - initialising Word at startup and processing all files before closing does seem like a good work around - though possibly a little resource hungry - hope all goes well
Yes - initialising Word at startup and processing all files before closing does seem like a good work around - though possibly a little resource hungry - hope all goes well

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
Best regards
Tracker Support
http://www.tracker-software.com
OK, I've merged all the code into a single procedure and it almost works. 
I can't seem to get rid of a Save As file dialogue for the PDF. Attached is the generated code for the procedure.
ABC report template, no report, uses a queue as the source.
At procedure init, I load up the queue with a DIRECTORY() command, then for each queue entry, I do some fiddling around and eventually call a Doc2Pdf routine. This routine's code is cribbed from a hidden button that generates the pdfxchange code for me.
Any ideas would be appreciated...
--David

I can't seem to get rid of a Save As file dialogue for the PDF. Attached is the generated code for the procedure.
ABC report template, no report, uses a queue as the source.
At procedure init, I load up the queue with a DIRECTORY() command, then for each queue entry, I do some fiddling around and eventually call a Doc2Pdf routine. This routine's code is cribbed from a hidden button that generates the pdfxchange code for me.
Any ideas would be appreciated...
--David
- Attachments
-
- Impor009.zip
- (5.51 KiB) Downloaded 164 times
-
- Site Admin
- Posts: 1412
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
- Contact:
Hi David!
I don't see anything wrong in detail with what you have sent us. However I am concerned that what you are doing may be causing a synchronization issue with the PDF-XChange Driver, and therefore the registry codes may not being set and the driver is using default values, one of which is to call the Save As file dialogue.
You are running a loop using part of the PDFXCDriver30 class, with the Init and Kill for the class outside the loop. We never intended for the class to be used in this fashion, and I cannot say for certain that this will or will not work as intended.
But unless you take care to use EVENT:PDF3DRV_DocSaved to control the actual processing you may be creating the conditions for sync failure. Remember, there is a time delay between the time that Word finishes prinitng to the spooler, and the time that the PDF file generation is complete. OI knows nothing of this, nor should it.
Your loop has to read a queue record, begin the print process, WAIT for EVENT:PDF3DRV_DocSaved to signal that the PDF file has been created, and THEN proceed to save the output.
HTH!
I don't see anything wrong in detail with what you have sent us. However I am concerned that what you are doing may be causing a synchronization issue with the PDF-XChange Driver, and therefore the registry codes may not being set and the driver is using default values, one of which is to call the Save As file dialogue.
You are running a loop using part of the PDFXCDriver30 class, with the Init and Kill for the class outside the loop. We never intended for the class to be used in this fashion, and I cannot say for certain that this will or will not work as intended.
But unless you take care to use EVENT:PDF3DRV_DocSaved to control the actual processing you may be creating the conditions for sync failure. Remember, there is a time delay between the time that Word finishes prinitng to the spooler, and the time that the PDF file generation is complete. OI knows nothing of this, nor should it.
Your loop has to read a queue record, begin the print process, WAIT for EVENT:PDF3DRV_DocSaved to signal that the PDF file has been created, and THEN proceed to save the output.
HTH!
-
- Site Admin
- Posts: 1412
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
- Contact:
-
- Site Admin
- Posts: 8210
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
ok - thanks David.
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
Best regards
Tracker Support
http://www.tracker-software.com
Hi David,
I am strugling with a similar job (see this post: http://www.tracker-software.com/forum/v ... php?t=2437).
I have tried using the Office Inside demo-program but are stuck when converting multiple docs.
If you get a solution I would very much like to hear about it.
Cheers,
I am strugling with a similar job (see this post: http://www.tracker-software.com/forum/v ... php?t=2437).
I have tried using the Office Inside demo-program but are stuck when converting multiple docs.
If you get a solution I would very much like to hear about it.
Cheers,
.::Poul Jensen::.
Clarion developer
Clarion developer
-
- Site Admin
- Posts: 8210
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Hi Poul/David,
Is it possible one of you could provide a complete small sample app that demonstrates the issues you are experiencing with some sample .doc files and I will have this checked here and see if we can get to the bottom of this once and for all ?
The more we get from you - the better, in terms of a ready to run app (of course we do need source) .
please also confirm specifically the version of Clarion and Windows on which you are testing when you send the app.
If its too big or private to post here - you can of course send to me direct (zipped) : johnv@tracker-software.com
Many thanks
Is it possible one of you could provide a complete small sample app that demonstrates the issues you are experiencing with some sample .doc files and I will have this checked here and see if we can get to the bottom of this once and for all ?
The more we get from you - the better, in terms of a ready to run app (of course we do need source) .
please also confirm specifically the version of Clarion and Windows on which you are testing when you send the app.
If its too big or private to post here - you can of course send to me direct (zipped) : johnv@tracker-software.com
Many thanks
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- Site Admin
- Posts: 8210
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Thanks Poul,
received by email.
received by email.
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
Best regards
Tracker Support
http://www.tracker-software.com
-
- Site Admin
- Posts: 1412
- Joined: Wed Jun 30, 2004 4:45 pm
- Location: Maryland, USA
- Contact:
Hi Poul, David!
I dug through the class files and did find a bug with some old code that was suppressing the messages and hence "jamming" the app. That's been fixed.
Poul: I added ONE line of code in your PrintDocPdfA procedure:
It hides the procedure window when doing a batch run.
I'll email the zip files to you both and to John V; I cannot seem to upload the attachment.
I dug through the class files and did find a bug with some old code that was suppressing the messages and hence "jamming" the app. That's been fixed.
Poul: I added ONE line of code in your PrintDocPdfA procedure:
Code: Select all
if g:BatchRun = 1
0{PROP:Hide} = True
post(event:accepted, ?ButtonDanPdf )
end
I'll email the zip files to you both and to John V; I cannot seem to upload the attachment.
-
- Site Admin
- Posts: 8210
- Joined: Tue Jun 29, 2004 10:34 am
- Location: Vancouver Island - Canada
- Contact:
Excellent - thanks Poul 

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
Best regards
Tracker Support
http://www.tracker-software.com