Setting output folder using MSaccess (abandoned)  SOLVED

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers only - Please do not post requests for older versions of PDF-XChange or the PDF-Tools/OFFice2PDF applications here

Moderators: Tracker Support, TrackerSupp-Daniel, Sean - Tracker, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
disrees
User
Posts: 4
Joined: Mon Aug 28, 2023 6:31 am

Setting output folder using MSaccess (abandoned)

Post by disrees »

I am using VBA within MSAccess to produce overnight reports automatically.
Path to Access Database: D:\Users\David\OneDrive\Documents\BackupFolder\Scanned Documents\Bank Accounts\_Database\financesDEV.accdb

Using PDFSaver I created a new instance of PDF-Change printer, "PDF-Xchange Prepend" to prepend to an existing PDF without user intervention by use of an MSAccess macro.
The following parameters were modified from standard:
Save.RunApp=0; No
Save.WhenExists=4; InsertBefore
Save.ShowSaveDialog=0; No

The task is executed by MSAccess macro.
Step1 sets Save.Path=D:\ScheduledTasks\FinanceDB\Reports using a function that runs the following code:
"C:\Program Files\Tracker Software\PDF-XChange Standard\pdfSaver.exe" "/SetOptions" "Save.Path=D:\ScheduledTasks\FinanceDB\Reports" "/Printer" "PDF-Xchange Prepend"
Step2 runs the report

This runs OK when I run 'by hand', a file is printed and prepends successfully.

The issue is that I am unable to direct the output to a specific folder, it always ends up in the folder D:\Users\David\OneDrive\Documents.
Dumping the parameters subsequent to the above shows Save.Path = D:\ScheduledTasks\FinanceDB\Reports as expected.

On resetting Save.ShowSaveDialog=1 and manually printing using printer "PDF-Xchange Prepend" I get:
The UI pops up offering the user Downloads folder! (Possibly the last time I used this manually perhaps?)

Can you advise just how I can define the output folder as desired.
It seems that the parameter Save.Path is not being used for this.

PDF-Xchange Pro 10.0.1 (build 371)
Last edited by disrees on Sat Sep 09, 2023 7:49 am, edited 2 times in total.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 9104
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting output folder programatically

Post by TrackerSupp-Daniel »

Hello, disrees

The End user Printers are not designed to be used in this way, so it does not alllow for that kind of external control.
While PDF-Saver can be used to modify a small selection of settings (detailed in this article), most cannot be handled this way, and you will want to use the UI to create profiles which can be selected when printing to change most factors, like the save location.

If you need to accomplish something like this, you would need to apply for a license to our printer API, by emailing sales@pdf-xchange.com explaining what you hope to accomplish with the tools we provide. Management will review that request and give you options if you qualify.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
disrees
User
Posts: 4
Joined: Mon Aug 28, 2023 6:31 am

Re: Setting output folder programatically

Post by disrees »

Thanks Daniel,
Not the answer I was hoping for but instead I've followed your pointers and tried the following.
Using Printer "PDF-Xchange Prepend" I used the printer preferences for the Default Settings as follows:

TAB: Default File Append
"Prepend output with a pdf file" ->Selected
"File:" ->Left blank
"Prepend output with a pdf file" ->Deselected

TAB: Save Options
Deselected ->"Save As Dialog"
Path: ->"set to desired path"
File: ->"Set to desired filename"
All others: ->Deselected/blank

Tab "Run Options"
Run Appliction After Printing": ->deselected

Apply and OK

The following parameters were found using PDFsaver dump command (selection only)
Misc.AltDash=1; Yes
Name=""
Save.File="Overnight Balances (Open Accounts).pdf"
Save.Path="D:\ScheduledTasks\FinanceDB\Reports"
Save.RunApp=0; No
Save.AppName=""
Save.SaveType=2; Save
Save.AppParams="%f"
Save.RunCustom=0; No
Save.StripPath=0; No
Save.AutoNumber.Start=1
Save.AutoNumber.NumDigits=3
Save.WhenExists=4; InsertBefore
Save.UseLastPath=0; No
Save.ShowSaveDialog=0; No

When the application runs the print function runs without any interaction and prepends to the file.
Only problem is that bthe file created exist in my user documents folder, not "D:\ScheduledTasks\FinanceDB\Reports" as specified.
Is this the expected action or is there something I'm missing or doing incorrectly?
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 9104
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting output folder programatically

Post by TrackerSupp-Daniel »

Hello, disrees

Was the application running while you made these changes to the driver? In many cases, applications will retain "last used" settings for printers during an active session (and our driver is no exception). As such, changing the global default may not have an effect until after you have restarted the app, or in some rarer cases, the entire PC.
In my tests so far, setting this before launching the apps I was printing from, allowed them to use the newly set save location's without issue.

Perhaps seeing a screenshot of your preferences menu would help me to pick something out that I am missing in the text summary...

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
disrees
User
Posts: 4
Joined: Mon Aug 28, 2023 6:31 am

Re: Setting output folder programatically

Post by disrees »

Thanks Daniel,
As far as the application running during the change of parameters I have tried making the changes both before and during opening and running the app (MSAcces) with exactly the same results.

One additional parameter I have also changed: "Save.UseLastPath" to 1=Yes but this also had no effect.

I then opened the printing preferences and created and set a new profile (called Silent Prepend) within PDF-Xchange Prepend.
I modified options in only two categories, Default file append and Save.
Attached are the screenshots of those changes.
I also attach a screenshot of the Devices and Printers screen showing that the Standatd printer which shows two alternative printers. This I believe from another post on this forum is simply the way windows display printers which share the same driver.
Certainly when I look for all printers via a VBA routine it shows two PDFXchange instances.
Screenshot 2023-09-07 220836.png
Screenshot 2023-09-07 220145.png
Screenshot 2023-09-07 220254.png
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 9104
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting output folder programatically

Post by TrackerSupp-Daniel »

Hello, disrees

Would it be possible for you to send us one of the files you are printing from MS Access to reproduce this? I have as of yet been unable to reproduce the issue, and the Dev team is asking for that to test with as well, just in case.

If the file contains any sensitive information I would request that you email it to support@pdf-xchange.com with a link to this forum post and "attn:Daniel/Ivan" in the subject line, so that it gets dropped in my folder..

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
disrees
User
Posts: 4
Joined: Mon Aug 28, 2023 6:31 am

Re: Setting output folder programatically  SOLVED

Post by disrees »

OK Daniel,
I think it's time to call a halt on this.
I tried a change of tack and did the following.
In the Preferences page of each PDFX-Change printer I created a watermark.
Selecting a file to print was fine, the process went as expected and the resulting document was watermarked.
When printing from within MSaccess however a watermark is never produced!
Heaven knows what is going on but I certainly don't!

I have come to the conclusion that there is something about printing from MSaccess that confuses the issue and it's easier to avoid the problem than trying to resolve it.

I have developed a convoluted procedure involving copying the destination file to the location that MSaccess always prints to and then copying the amended version back to the required destination folder.
This gives me the results I need and will do.

Thanks for trying to resolve the issue for me and put it down as one of life's mysteries.
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 9104
Joined: Wed Jan 03, 2018 6:52 pm

Re: Setting output folder programatically

Post by TrackerSupp-Daniel »

Hello, disrees

Understood, if you wish to look into this further in the future, please let us know.

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply