Reputation: 45
Is there any way to specify the file name when printing to PDF file. I can not find such a option. It only allows to specify file path not the file name
Upvotes: 0
Views: 911
Reputation: 136
If you use the OnPrintComplete event the PrintCompleteEventArgs parameter gives you a list of files that were created.
You can use this method to rename the files.
Upvotes: 1
Reputation: 1
This code it's a possible workaround for that problem...
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
}
So with that you will save the file. I think it could be great if awesomium makes a method that accepts a file!...
Upvotes: 0