I am attempting to use PDFCreator's AutoSave mode in a larger application using the COM interface from C#/.NET. Some of the time, PDFCreator doesn't respect the options I give it regarding AutoSave filename and directory; the file ends up in my Documents library, with a date/time filename (ie, "20130705070827.pdf").
Do you have any advice for forcing PDFCreator to honor the Autosave Directory and Filename?
Windows 8, PDFCreator v1.7.0
Relavent code:
PDFCreator.clsPDFCreator _PDFCreator = new PDFCreator.clsPDFCreator();
String parameters = "/NoProcessingAtStartup";
if ( !_PDFCreator.cStart( parameters, false ) )
{
// Close the existing instance and re-open a new one
ClosePDFCreator( _PDFCreator );
if ( !_PDFCreator.cStart( parameters, false ) )
return false;
}
_PDFCreator.set_cOption( "UseAutosaveDirectory", 1 );
_PDFCreator.set_cOption( "AutosaveDirectory", Path.GetDirectoryName( sFullPath ) );
_PDFCreator.set_cOption( "AutosaveFilename", Path.GetFileNameWithoutExtension( sFullPath ) );
_PDFCreator.set_cOption( "AutosaveFormat", 0 );
_PDFCreator.set_cOption( "AutosaveStartStandardProgram", 0 );
_PDFCreator.set_cOption( "UseAutosave", 1 );
_PDFCreator.cPrinterStop = false;
System.Drawing.Printing.PrintDocument pd = OtherComponent.GetPrintDocument();
pd.DocumentName = Path.GetFileNameWithoutExtension( sOutputFile );
pd.PrinterSettings.PrinterName = "PDFCreator";
pd.Print();
Thank you!
--Chris W.