translated:I am creating a pdf with PrintDocument then I want to view it. code
private void CrearArchivo() { PrintDocument documento = new PrintDocument(); documento.PrintPage += Documento_PrintPage; documento.PrinterSettings.PrintToFile = true; string carpeta = Path.GetTempPath()+ @"\prueba.pdf"; documento.PrinterSettings.PrintFileName = carpeta; documento.Print(); MessageBox.Show(""); axAcroPDF1.src = carpeta; axAcroPDF1.Focus(); }
translated:If I remove the line MessageBox.Show(""); I can't view the file, it gives an error. But if I run it I can view the file.
translated:I have tried to perform the task in the background with BackgroundWorker, but nothing, I have to execute a message box to complete the entire action.
documento.Print(); documento.Dispose(); ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)