PDF export?
Hi,
we will need prepare version of our program after one week. Will be PDF export finished after one week?
Radek
we will need prepare version of our program after one week. Will be PDF export finished after one week?
Radek
Comments
We will add PDF export in the next week.
If you need PDF creation now you can install a free PDF creator that works with FastReports.NET (and FR Studio)
I've installed Ghostscript PDF and create all my FastReport PDF's that way.
For me it's been (much) faster than using the PDF export in FastReport Studio, and produces (much) smaller files.
Since it's installed as a virtual printer, you need to add a Mutex to make sure you are the only one printing to that printer at a time. I use this in my web server for FR reports so it is quite possible that there are several pdf files being created at the same time. If you are only creating one report at a time, you can leave off the mutex stuff.
I've attached a sample pdf created from the FR.NET Bar Code Demo
Here is some code for FR.NET:
private void button1_Click(object sender, EventArgs e)
{
report1.Prepare();
report1.PrintSettings.ShowDialog = false;
Mutex WaitMutex = new Mutex(false, "GhostscriptMutex");
try
{
WaitMutex.WaitOne();
try
{
report1.PrintSettings.Printer = "Ghostscript PDF";
report1.Print();
}
finally
{
}
try
{
string command = "gswin32c -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=TestPDF.pdf -fc:\\spooldir\\spool.ps";
Process pdfProcess = new Process();
StreamWriter writer;
StreamReader reader;
ProcessStartInfo info = new ProcessStartInfo("cmd");
info.WorkingDirectory = System.AppDomain.CurrentDomain.BaseDirectory;
info.CreateNoWindow = true;
info.UseShellExecute = false;
info.RedirectStandardInput = true;
info.RedirectStandardOutput = true;
pdfProcess.StartInfo = info;
pdfProcess.Start();
writer = pdfProcess.StandardInput;
reader = pdfProcess.StandardOutput;
writer.AutoFlush = true;
writer.WriteLine(command);
writer.Close();
string ret = reader.ReadToEnd();
}
catch (Exception ex)
{
Debug.WriteLine("Exception " + ex.ToString());
throw ex;
}
}
finally
{
WaitMutex.ReleaseMutex();
}