Jump to content

Help needed with UniHTLMFrame.PaintTo


mikeog

Recommended Posts

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

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

post-917-0-44632700-1347111069.png

post-917-0-24441500-1347111095.png

Link to comment
Share on other sites

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

  • 2 years later...
  • Administrators

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...