0
打印到PDF文件时是否有任何指定文件名的方法?我找不到这样的选择。它仅允许指定文件路径不是文件名Awesomium浏览器打印到文件
打印到PDF文件时是否有任何指定文件名的方法?我找不到这样的选择。它仅允许指定文件路径不是文件名Awesomium浏览器打印到文件
此代码是针对这个问题可能的解决方法......
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使得接受文件的方法更好!...
如果使用OnPrintComplete事件,PrintCompleteEventArgs参数将为您提供创建的文件列表。
您可以使用此方法重命名文件。