Save.Path issue

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

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

Post Reply
glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Save.Path issue

Post by glima » Mon Mar 20, 2017 7:09 pm

The path provided cannot have an extension

We combine multiple files into a single PDF file using the driver. We then run a process with the completed PDF

string TempFolder = Path.Combine(Path.GetTempPath(), "[TEST]" + Path.GetRandomFileName());

PDFPrinter.set_Option("Save.Path", TempFolder);
PDFPrinter.set_Option("Save.File", Filename);
PDFPrinter.set_Option("Save.WhenExists", "Append");
PDFPrinter.ApplyOptions(0);

PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = printerName;
pd.DocumentName = "TEST 2017 - "+ inputfile; //Name that appears in the printer queue
pd.Print();

In this C# example the Path.GetRandomFileName() returns something like this "zpcx2wxf.yyt"

When appending documents the driver defaults to the pd.DocumentName or if omitted it defaults to "document.PDF"

if you do this everything works properly

string TempFolder = Path.Combine(Path.GetTempPath() "[TEST]" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Re: Save.Path issue

Post by glima » Mon Mar 20, 2017 10:34 pm

That was not the cause of the problem. The issue is due to multiple instances of a virtual printer being generated

The files being converted so quickly that I get

TEST Printer
TEST Printer 1
TEST Printer 2
TEST Printer 3
TEST Printer 4

After editing the code the instance disappeared and did not appear because of stepping through the application.

How can we stop multiple instances. These files need to be processed sequentially.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13544
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Save.Path issue

Post by Tracker Supp-Stefan » Tue Mar 21, 2017 11:54 am

Hello glima,

Can you wait for e.g. the OnFileSaved event:
http://help.tracker-software.com/DEV/de ... ynchronous
And only start the next document when the previous one has finished?

Cheers,
Stefan

glima
User
Posts: 84
Joined: Mon Sep 20, 2004 4:27 pm
Location: Phoenix, AZ

Re: Save.Path issue

Post by glima » Wed Mar 22, 2017 8:25 pm

Oops.

This all happened when another developer added an instantiation of the driver using our wrapper class.Once we removed this everything is working fine.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13544
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Save.Path issue

Post by Tracker Supp-Stefan » Thu Mar 23, 2017 9:39 am

Hi glima,

Glad to hear that you've found a solution to the problem!

Cheers,
Stefan

Post Reply