Hi there,
This is a problem I have run into using CEFSharp, which is really just a simple .NET wrapper around CEF.
The problem is that if you try to access the generated PDF file directly after the callback function has been fired an IO exception is raised indicating that the file is still in use. When CEF fires the CefPdfPrintCallback::OnPdfPrintFinished callback the file lock on the generated PDF file has not yet been released.
If you however wait for a few ms before attempting to access the generated PDF file, it then works -> NO IO.Exception.
Windows 10 x64, CefSharp v51.0.0.
Problem could be reproduced with both the regular and offscreen browsers.
Is this expected behaviour/as designed?
To me it seems like a bug, it would be better if the file lock is released before the callback is executed.
Here is the link to the issue I filed for the CefSharp project with some more information.
https://github.com/cefsharp/CefSharp/issues/1807#issuecomment-249059697
Thank you!