We've been using the V4 Drivers API for about a year in a .NET C# App to convert a variety of formats (Office, HTML etc.) with great success. Yesterday we tried to upgrade to V5 but ran into a couple of issues:
1. OnFileSaved and OnError events are not triggering, even though we can see that a pdf file has been written to disk
2. %[DocName] Macro truncates filenames, we use GUID(36 alphanumeric chars) as file names due to some unique naming constraints
3. PdfSaver5.exe does not unload after closing our application - probably related to the events as no unregistering is taking place if the events have not fired.
This behavior seems to occur on all our development machines (Window 7 Enterprise x64/x86)
We set the default printer to PDF-Xchange and use automation to print (sample code below). Are we doing something wrong? Has the API changed from V4 and our initial code is not valid anymore? Any feedback on this matter is greatly appreciated.
Thanks & regards,
Ciprian.
Sample code for printer initialization:
Code: Select all
var prnFactory = new PXCComLib5.CPXCControlEx();
_pdfPrinter = (PXCComLib5.CPXCPrinter)prnFactory.get_Printer( .. .. .. );
_pdfPrinter.OnFileSaved += prn_OnFileSaved;
_pdfPrinter.OnError += prn_OnError;
_pdfPrinter.set_Option("Save.SaveType", 2); // Save
_pdfPrinter.set_Option("Save.ShowSaveDialog", false);
_pdfPrinter.set_Option("Save.WhenExists", 1); // Overwrite
_pdfPrinter.set_Option("Save.RunApp", false);
_pdfPrinter.set_Option("Save.StripPath", true);
_pdfPrinter.set_Option("Saver.ShowProgress", false);
_pdfPrinter.set_Option("Save.Path", destinationFolder);
_pdfPrinter.set_Option("Save.File", ConvertedFilesPrefix + "%[DocName]");
_pdfPrinter.SetAsDefaultPrinter();