Dan McCormick

Dan McCormick

  • NA
  • 7
  • 7.1k

Get Save Dialog Info from PDF Printer

Oct 15 2010 8:50 AM


I want to automatically launch the Acrobat Reader when a PDF print image file is created from my app.   I see that the Windows Save Dialog Control is launched and has boxes labeled 'File name:' and 'Save as type:'.  File name has an entry with the .pdf extension.  Save as type has an entry of PDF files.  
 
I cannot seem to find the way to reference the Control and one of these properties in this context.   I have a work around using the PrinterSettings but it makes some assumptions that are not very strict.  PrinterSettings or other properties I have tried do not seem to include the Save Dialog box properties.

What I do now is use the PrinterName and Search it for strings: 
if (pd.PrinterSettings.PrinterName.ToString().ToUpper().Contains("PDF") || (pd.PrinterSettings.PrinterName.ToString().ToUpper().Contains("ADOBE")))
{
Process.Start(PDFfile);
}

Not too elegant or complete.

What I would like to do is something like:
if (PDFSaved)
{
...
}

Is there a way to find a property that will lead to setting a boolean for PDFSaved based on the Save Dialog box. 
 
Tks.