有没有办法在打印到PDF文件时指定文件名。我找不到这样的选择。它只允许指定文件路径,而不允许指定文件名
发布于 2014-02-25 19:49:16
如果使用OnPrintComplete事件,则PrintCompleteEventArgs参数将为您提供已创建文件的列表。
您可以使用此方法重命名文件。
发布于 2014-01-08 02:12:44
这段代码是这个问题的一种可能的解决方法...
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能做一个接受文件的方法,那就太好了!
https://stackoverflow.com/questions/17263389
复制相似问题