I got a thread that create pages beetween printer.beginDoc
, and printer.endDoc
and on thread.onTerminate
i call shellExecute
to open the pdf flie, and it is not complete.
When i open it after 10 seconds, everything is ok.
Is there a way to know when the pdf file is ready. I suppose that it should finish printing? Or maybe printSpooler?
BeginDoc ... EndDoc
, to a virtual printer, typically (probably always) the output file isn't created at the timeEndDoc
is called. It will be completed soon afterwards.printer.PrinterIndex := Printer.Printers.IndexOf('Microsoft Print to PDF'); Printer.GetPrinter(Device, Driver, Port, DeviceMode); Printer.SetPrinter(Device, Driver, fileName, 0);
WherefileName
is a string with file address