CarloM 3 Posted March 13, 2019 Hello When I show a PDF via TWebBrowser on Mac OS, it only works well for first time. Then when I try to view another PDF raises an error "The specified file was not found", on Windows works well. I use delphi professional rio update 1. I see related question but not solution on these links: https://forums.embarcadero.com/thread.jspa?threadID=252540 https://forums.embarcadero.com/thread.jspa?threadID=260250&tstart=0 Regards Share this post Link to post
Dave Nottage 557 Posted April 10, 2019 (edited) I'll take a look into this.. hopefully in the next few hours. If there's a QP entry, please let me know Edited April 10, 2019 by Dave Nottage Share this post Link to post
CarloM 3 Posted April 10, 2019 Hello Dave, Yes, it was reported to embarcadero https://quality.embarcadero.com/browse/RSP-23976?filter=-2 Share this post Link to post
Dave Nottage 557 Posted April 10, 2019 You might have to provide a reproducible test case, because I'm unable to reproduce the problem. I deployed a couple of example PDF files in the app, using the default remote path of /Contents/MacOS/Startup, and used this code to load them: procedure TForm1.OpenPDF(const AFileName: string); var LSourceName, LDestName: string; begin // Bit of a "hack" to get the exact paths of the pdf files deployed to /Contents/Resources/Startup LSourceName := TPath.GetDirectoryName(ParamStr(0)); LSourceName := TPath.Combine(StringReplace(LSourceName, '/MacOS', '', []), 'Resources/Startup/' + AFileName); LDestName := TPath.Combine(TPath.GetTempPath, 'open.pdf'); // Delete any existing temp file TFile.Delete(LDestName); // Copy from resources to common location TFile.Copy(LSourceName, LDestName); WebBrowser1.Navigate('file://' + LDestName); end; Works every time. My guess is that the problem is with your file retrieval/copy, rather than it being a WebBrowser issue Share this post Link to post
CarloM 3 Posted April 11, 2019 Hello Dave, In Quality central I uploaded a repoducible demo. https://quality.embarcadero.com/browse/RSP-23976?filter=-2. . Thank you Share this post Link to post
pcplayer99 11 Posted May 12, 2019 (edited) maybe need another way: free the TWebBrowser and create it again ? Or, you need a html file with JavaScrip to load PDF file, you just load html file into TWebBrowser and let the javascript to load PDF for you. I just guess, no try. I have no Apple mobile phone. Edited May 12, 2019 by pcplayer99 Share this post Link to post