2013-06-23 99 views

回答

0

此代碼是針對這個問題可能的解決方法......

 int dev = 0; 
     String path = ""; 
     String ruta = ""; 

     try 
     { 
      path = // Make a method to retrieve the file to save (savefiledialog) 

      ruta = // Make a method to get the path without the file and extension 

      dev = visorMapas.PrintToFile(ruta, Awesomium.Core.PrintConfig.Default); 

      try 
      { 
       System.IO.File.Move(ruta + "\\doc_" + dev + ".pdf", path); // This will rename it! 

       MessageBox.Show("Work done!"); 
      } 
      catch (Exception ex) 
      { 
       // Oh no! 
      } 
     } 
     catch(Exception ex) 
     { 
      // Bad thing 
     } 

因此,既然你保存文件。 我認爲如果awesomium使得接受文件的方法更好!...

1

如果使用OnPrintComplete事件,PrintCompleteEventArgs參數將爲您提供創建的文件列表。

您可以使用此方法重命名文件。