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()));
Save.Path issue
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan
-
- User
- Posts: 28
- Joined: Mon Sep 20, 2004 4:27 pm
- Location: Phoenix, AZ
Re: Save.Path issue
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.
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.
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Save.Path issue
Hello glima,
Can you wait for e.g. the OnFileSaved event:
https://help.pdf-xchange.com/DEV/de ... ynchronous
And only start the next document when the previous one has finished?
Cheers,
Stefan
Can you wait for e.g. the OnFileSaved event:
https://help.pdf-xchange.com/DEV/de ... ynchronous
And only start the next document when the previous one has finished?
Cheers,
Stefan
-
- User
- Posts: 28
- Joined: Mon Sep 20, 2004 4:27 pm
- Location: Phoenix, AZ
Re: Save.Path issue
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.
This all happened when another developer added an instantiation of the driver using our wrapper class.Once we removed this everything is working fine.
-
- Site Admin
- Posts: 17960
- Joined: Mon Jan 12, 2009 8:07 am
- Location: London
Re: Save.Path issue
Hi glima,
Glad to hear that you've found a solution to the problem!
Cheers,
Stefan
Glad to hear that you've found a solution to the problem!
Cheers,
Stefan