mikeog Posted September 7, 2012 Share Posted September 7, 2012 Has anybody used the PaintTo method of UniHTMLFrame? I want to save the contents of the UniHTMLFrame as an image so that it can be included in a report but I am struggling. I have tried using a UniImage and a UniCanvas as the target but all I get is a blank image. Any help/pointers would be appreciated. Mike Link to comment Share on other sites More sharing options...
zilav Posted September 7, 2012 Share Posted September 7, 2012 It is impossible to do that from server. And include html as an image inside a report? Modern report generators have enough formatting features, you should rethink the logic of your app. 1 Link to comment Share on other sites More sharing options...
mikeog Posted September 8, 2012 Author Share Posted September 8, 2012 Thanks Zilav. Maybe if I explain exactly what I am trying to do, you will see why I want to save the UniHTMLFrame image. My application has a Client Record form which contains a UniHTMLFrame to display the client's location on a Google map. A summary of the Client Record can be printed, using FastReports, and I want to include the Google map image on this summary report to help in locating the client's address. The attached images show how it looks in the original application, which used a TWebBrowser to display the map. The TWebBrowser allows access to the ViewObject using: WebBrowser1.Document.QueryInterface(IViewObject, viewObject) which can then be drawn on a bitmap canvas and saved to a stream, from which it can be used by the report. I thought that the PaintTo method of UniHTMLFrame would allow me to do something similar but, it seems not. Perhaps an Ajax event might do the trick, but I am not smart enough to know where to begin. Maybe if I rephrased the original topic title as "How do I include a Google Map from a UniHTMLFrame in a report?" it would describe my problem more accurately. Thanks, Mike Link to comment Share on other sites More sharing options...
zilav Posted September 8, 2012 Share Posted September 8, 2012 I see what you try to achieve, but remote server taking a snapshot of client browser? Impossible. You should make your report as a separate static html page (including google map), save it to a file, and then link it with UniLabel: <a href="report.html" target="_blank">Print</a> When user clicks this link, a new tab/window will open with your report and user can print it from browser. Link to comment Share on other sites More sharing options...
mikeog Posted September 11, 2012 Author Share Posted September 11, 2012 Thanks Zilav, Looks like I am still in a pure Delphi mode and I need to adjust my mindset to a different way of thinking. Mike Link to comment Share on other sites More sharing options...
juniorcsa Posted June 5, 2015 Share Posted June 5, 2015 How to obtain the html code of a page open in UniURLFrame1.URL.example:// Loading the siteUniURLFrame1.URL:='http://www.nfe.fazen...do=XbSeqxE8pl8='// Getting html code site after being loadedUniMemo1.text: = UniURLFrame1.html.text;My problem is getting the code, someone can help me with this? Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted June 5, 2015 Administrators Share Posted June 5, 2015 How to obtain the html code of a page open in UniURLFrame1.URL. example: // Loading the site UniURLFrame1.URL:='http://www.nfe.fazen...do=XbSeqxE8pl8=' // Getting html code site after being loaded UniMemo1.text: = UniURLFrame1.html.text; My problem is getting the code, someone can help me with this? Please do not flood forums with same question! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now