Save.ShowSaveDialog parameter not working

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
pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Save.ShowSaveDialog parameter not working

Post by pglewis » Mon Apr 02, 2007 8:11 pm

I'm specifying the full path for the saved file in the "Save.FullFileName" parameter and specifying "No" for the value of "Save.ShowSaveDialog".

PDFSaver still displays the save dialog.

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 » Tue Apr 03, 2007 9:39 am

Hi,

Please could you advise what Windows OS is in use, the development tool being used and supply a code snippet relevant to the function (sufficient to show complete save operation including any variables created and used) and we would be pleased to advise

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

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Tue Apr 03, 2007 1:57 pm

Tracker Support wrote:Hi,

Please could you advise what Windows OS is in use, the development tool being used and supply a code snippet relevant to the function (sufficient to show complete save operation including any variables created and used) and we would be pleased to advise

Thanks
The OS for the main development enviornment is XP Pro, SP2. We also support quite a few clients that use Windows 2000 and test in that environment. The application is an Outlook COM add-in developed in VB6.

I'll see if I can pull together a sufficient "snippet" for the PDF portion of the code and post a passworded zip file here.

I'm nearly certain there is something simple I am missing since a forum search did not return anything else. At the same time, I'm stumped since I'm not sure what else to do other than specify "No" for the value of Save.ShowSaveDialog. Everything else seems to work correctly if I hit "Cancel" on the save dialog. If I exclude the Save.ShowSaveDialog registry entry I will get multiple prompts to save after hitting cancel (like 4 times), so the registry entry is doing something... it's just not supressing the save dialog altogether.

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Tue Apr 03, 2007 2:39 pm

This is the module that handles almost all of the Tracker-specific tasks, including hooking the windows messages and writing all the registry entries.
Attachments
modTrackerPDF.zip
(2.45 KiB) Downloaded 129 times

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 » Tue Apr 03, 2007 7:42 pm

Hi,

you appear to be missing one parameter - please add this parameter to the registry:

RegSetValueEx hKey, "Save.Type", 0, 1, "2", 2

HTH
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

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Tue Apr 03, 2007 8:01 pm

Tracker Support wrote:Hi,

you appear to be missing one parameter - please add this parameter to the registry:

RegSetValueEx hKey, "Save.Type", 0, 1, "2", 2

HTH
I had tried this before, but kept my fingers crossed and tried it again. Added the line with no change: I'm still prompted with a save dialog.

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 » Tue Apr 03, 2007 8:20 pm

Hi,

You say :
"I'm specifying the full path for the saved file in the "Save.FullFileName" parameter"

Can you please give a speific 'literal' example of this full path and advise if it is a local or Network path (if so - is it a mapped drive or UNC path?)

If this is just a file name, it will be ignored.

Please also see the example VB app : VBExAPI - this works correctly here - does it work correctly for you ?

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

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Tue Apr 03, 2007 8:38 pm

The value passed to "Save.FullFileName" on an actual example I just ran is:

C:\Documents and Settings\pgl\Local Settings\Temp\scrubber\PlanTemplates.pdf

We use a Temp location since we're actually processing attachments from email. We save a temp copy of the attached document(s), convert to PDF, then swap the original attachment for the converted file.

I will test the example code and let you know what I find.

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 » Tue Apr 03, 2007 8:42 pm

ok - but I 'suspect' therein lies the problem possibly a timing issue ?
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

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Tue Apr 03, 2007 8:54 pm

Tracker Support wrote:ok - but I 'suspect' therein lies the problem possibly a timing issue ?
I'm not sure I follow you.

We do the work of saving the document to the temp directory, open Word, do some automation tasks including setting the printer to the Tracker driver, and only after all this is done do we hook the windows messages and print the document. We're not trying to do all of this asynchronously and hoping it completes on time, if that's what you're suggesting.

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 » Tue Apr 03, 2007 8:56 pm

Ok - then timing is not a problem it would appear.

have tested this end with the VB example mentioned - with your path as the parameter and all works correctly, so it really would appear the issue is somewhere in your process or code.
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

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Tue Apr 03, 2007 10:17 pm

I'm not quite ready to rule out a timing issue... I just don't want it to be something so sticky :).

I will test the example code tomorrow morning and see what happens. That is the best test to perform at this point. Thanks for the help thus far.

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 » Wed Apr 04, 2007 11:24 am

Hi,

Ok, good luck - please advise if the testing provides a satisfactory answer to the issue.
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

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Wed Apr 04, 2007 2:29 pm

The example code works correctly for me.

I'm going to try an approach without registering the messages and hooking the WindowsProc, as the sample code does not do this. We have no real need to, we determine that the printing is complete through other methods anyway.

pglewis
User
Posts: 17
Joined: Thu Jul 13, 2006 4:22 pm

Post by pglewis » Wed Apr 04, 2007 3:20 pm

Finally, I have the issue resolved. It was our code and it was a timing issue.

We've had failures in the past calling Word's PrintOut method and have our print routine in a loop in order to reattempt if the first try fails. We wait for Word's BackgroundPrintingStatus to indicate that printing is complete, then check for the existence of the PDF file to confirm that we completed successfully. Unfortunately, the 3.x driver seem to complete the PDF just a smidge later that the 2.x driver did (I'm only assuming here, since we did not see this issue with the 2.x driver). This results in a second pass through the loop and a second call to Word's PrintOut method. This second print attempt did not specify the ShowSaveDialog.

I was unable to troubleshoot this section very well before since we had the message pump hooked during this section of code, and setting breakpoints for debugging would net you a locked system.

I can hang my head in shame and say that a "Sleep 250" was all I needed to fix this.

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 » Wed Apr 04, 2007 3:54 pm

Aha :)

Pleased you got there and all is now 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

Post Reply