Save.Path issue
Posted: 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()));
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()));